Questions tagged as 'asp.net-mvc'

2
answers

Can not implicit convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.List'

I have the following method below for the purpose of returning notifications that should be displayed for a given client and notifications that should be served to all clients. public List<TNotification> GetNotifications(TClient client)...
asked by 14.12.2016 / 11:59
1
answer

How to resolve the error: The best overloaded method match for

Following the templates this question when I have the following command: "The best overloaded method match for some invalid arguments" Controller public ActionResult Novo() { ViewBag.Nacionalidade = new Selec...
asked by 17.11.2015 / 17:19
2
answers

Button / link within a view redirecting to another view

I have the following address of a view : http://localhost/Configuracao/Details/1 Where to create a button / link that redirects to another address of another view as follows: <a href="@Url.Action("~/Views/Ativos/Index", Mo...
asked by 20.02.2015 / 19:20
3
answers

Send a ListT with several items to the controller

Well, I'm facing the following problem in a project I'm working on: how to pass a list (List) with approx. 500 ~ 1000 lines from the View to the Controller? In fact, this list has a field called "Selected (bool)" from which the user selects o...
asked by 03.05.2016 / 19:59
2
answers

How to model the products table for an e-commerce?

I'm having a question about how to model the Produto table of a small e-commerce I'm doing. I've been seeing some e-commerces and I came across the following situation: mm same product can have different colors and sizes, so when the cust...
asked by 23.08.2017 / 14:28
3
answers

Function Jquery can not find the Controller when I go to the server

During the development the function below finds the Control and makes the request correctly, however after publishing on the server the function no longer finds the Controller: During development I have to leave it like this: url: "/Contr...
asked by 22.06.2017 / 16:33
3
answers

Persist information using ViewBag?

I have my login screen and want to show the name is the user id logged on another screen, so I can use this information. In my controller : [HttpPost] public ActionResult Index(TB_USUARIO model) { //aqui vai pesquisa...
asked by 28.12.2015 / 18:16
2
answers

Null parameter in route

I'm trying to get into a controller , get a parameter and print it in the View by a ViewData or ViewBag . My Controller: public ActionResult Index(string information) { ViewData["Bag"] = information; return...
asked by 26.01.2016 / 16:22
2
answers

Context Dispose should be used in ASP.NET MVC?

In Web Forms whenever I mounted some kind of CRUD , I used using to make an implen in>. public List<Produtos> Lista () { using (var ctx = new DbContext()) { return ctx. Produtos.ToList(); } } In ASP.NET MVC th...
asked by 24.03.2016 / 19:47
2
answers

Any ASP.NET MVC solution for SQL injection?

I have in the application a code that validates the data entry, adjusting according to what is needed, would this be considered a good or a bad option? public static string ValidaDados(string str) { //Função simples para evitar at...
asked by 14.02.2017 / 13:10