Questions tagged as 'asp.net-mvc'

1
answer

How to add an already built view to a controller with asp.net core 2.0

I created a view (Razor Page) in an Asp.Net Core 2.0 project. As I build it from scratch and now I need to assign a controller to it. How do I do this?     
asked by 27.06.2018 / 18:43
2
answers

type 'T' must be a reference type in order to use it as parameter 'TEntity' in the generic type or method

When I try to query using IQueryable , I receive the following error:    Error 3 The type 'T' should be a reference type in order to use it as   parameter 'TEntity' in the generic type or method   'System.Data.Entity.DbContext.Set ()' 1s...
asked by 12.07.2018 / 21:50
1
answer

Configuring the Web.Config file

I wonder if I can leave the recipient's email in web.config, if so, how do I deploy it. I created a variable and gave the value of the email, however if I need to change I will have to compile dnv, if I can put the recipient in web.config and on...
asked by 02.03.2018 / 14:23
1
answer

Query too slow to export in excel

I have created a method to export some columns to xls and the process is very slow, it takes almost one minute to do the whole process. public void Download(string datainicio, string datafinal, int? searchContrato, string searchCliente, st...
asked by 21.03.2018 / 13:22
1
answer

Return data from 2 tables entity framework

I have the following table: Movement -movement -Indicator -ProductId When I select a particular customer I want to list all of the trades in which they are together with the product. how would I call this inside the controller? That's what...
asked by 07.02.2018 / 00:27
1
answer

Get parameter by url to my controller

I need my controller to get a parameter from a URL ( localhost/Check/123456 ), where 12346 would be the parameter. I configured RouteConfig: public static void RegisterRoutes(RouteCollection routes) { routes.Ignore...
asked by 05.02.2018 / 18:36
1
answer

Does not list database data correctly in ASP.NET View

The data was entered in the database, but in the View it does not show one of the fields. I've checked in SQL Server and it's all right, but the name field returns empty in view public ActionResult Index() { List<MovimentacaoVM>...
asked by 05.02.2018 / 16:48
1
answer

For with DateTime in Razor giving out of memory exception

I'm having the error out of memory, being caused by this Razor code in my cshtml file, and I can not identify where the problem is. @for(DateTime data = DateTime.Today.Date; data <= DateTime.Today.AddDays(7).Date; data.AddDays(1)) { @da...
asked by 25.01.2018 / 23:41
2
answers

Asp.Net MVC - Select item from a DropDownList reflect the same selection in another DropDownList that contains the same selection items

I have 02 DropDownList fields that have the same items to be selected, ie: Camera 1 Camera 2 Camera 3 Camera 4 Camera 5 Camera 6 Summarizing in large part the registrations that will be carried out, selecting a DropDownList item...
asked by 28.04.2018 / 04:19
2
answers

Remove from page mvc "© 2017 - Name Project"

I have a razor page that I call inside another page, and by having this ID: © 2017 - CronoParque, appears twice on the "same page", since I call one inside the other, I wonder if how can I disable this option from the page that I call. The image...
asked by 11.06.2018 / 13:43