Questions tagged as 'asp.net-mvc'

2
answers

How do I return an existing item in my enumerable via Contains?

I have an enumerable, and I want to query through one code per parameter. if the enumerable "Contains" Code, then it will return me all items that have that Code. See was trying to do so: public IEnumerable<Relacao> Listar(int Codigo)...
asked by 07.04.2015 / 13:47
2
answers

Foreach Duplicating Data

I have 2 foreachs , to do a date search in ViewBags , where I return both in a select. But for each item in the first foreach, it makes a full loop in the second, thus doubling the values, by each item in the first. Ex: If I ha...
asked by 02.02.2015 / 12:56
1
answer

Pass parameter to a C # MVC Controller

I'm learning ASP.NET MVC C # programs and would like to know how I pass data from a textbox to a controller. That is, I want to enter a value (id) in the View Index in a textbox and when I click Submit it returns me to View Details with the id t...
asked by 11.08.2015 / 18:40
2
answers

Is it bad practice to use foreach within View?

Is it bad practice to use foreach within View ? If so, how?     
asked by 17.06.2014 / 15:27
2
answers

ASP NET MVC5 - How to enable and disable HTML elements

The program has some customer data in the session, such as the CPF and Full Address (including the state where you live). If the client is from São Paulo, it enables a specific combo, if it is from another state, it does not enable it. In that c...
asked by 20.06.2014 / 22:04
2
answers

Upload Only part of the Site by clicking on ActionLink

I have the following ActionLink in my MasterPage . <div class="areaRetangulo"> <div class="col-lg-3 vermelho retanguloTamanho primeiraImagem"> <div class="triangulo trianguloVermelho">&...
asked by 18.08.2014 / 22:05
3
answers

Asp mvc how to change model data and move to another view

I'm starting in asp net mvc and I'm not able to get the changed data from a simple model and switch to another view. Here are the codes: Model: public class Produto { public int ProdutoId { get; set; } public string Desc...
asked by 27.09.2018 / 05:03
2
answers

Display layout only when view is not loaded via ajax

In my project, I'm developing so that the application works even if the user is disabled or unavailable. If JavaScript is not available, I load the page normally. If it is available, I load some of these pages in modal so that the flow is...
asked by 14.03.2014 / 21:02
2
answers

Claims Identity MVC

I'm having a hard time implementing Claims to perform user authorizations in my project, I've read a lot but can not execute. I'm using the NHibernate.AspNet.Identity for this reason I can not run as in forums and tutorials read, but I'm n...
asked by 06.07.2017 / 05:08
2
answers

Distinct in linq does not work

I made this linq in my model: public static List<MontaArvoreAcao> CriarListaArvoreAcao() { RupturaEntities db = new RupturaEntities(); var _listaUnidade = ( from r in db....
asked by 23.09.2014 / 18:44