Questions tagged as 'asp.net-mvc-5'

1
answer

Session configured in Web.Config and IIS Session State is expiring ahead of time

Scenery: I store the Session of the user to keep it logged in, but something is happening that in 10 minutes it is logged off because Session has expired. But in both% w / o% and Session State is parameterized for 120 minut...
asked by 25.10.2018 / 16:54
1
answer

Object can not be converted to dbnull in other types

Good evening, gentlemen. I am doing a user registration in college work and at logar this error appears. How can I resolve? privateUsuarioMapear(DataRowregistro){varusuario=newUsuario();usuario.Nome=Convert.ToString(registro["NOME"]);...
asked by 24.10.2018 / 17:58
2
answers

Call a method every time a Controller fires asp.net mvc

In my project I have a method that creates a menu in the Layout.cshtml layout page, for example, in my control HomeController.cs is this method, and in ActionResult Index() I call this method, only I have several other ActionRe...
asked by 27.05.2018 / 19:48
1
answer

Change only edited columns

In an application I'm developing, when trying to perform the update only on the fields that have been changed the Entity Framework is also changing the fields that do not need. Repository code: public void Update(T entity) { m_Context.En...
asked by 22.06.2018 / 00:49
1
answer

OAuth with Dependency Injection

Hello, I'm starting my studies with OAuth, and right away I came across a problem. I created the famous 'Startup' class, and I call it my provider as follows: public partial class Startup { public static OAuthAuthorizationServerOptio...
asked by 10.05.2018 / 15:36
1
answer

Error {"The object reference was not defined as an instance of an object."} System.NullReferenceException MVC ASP.NET

Well, it gave me an error on the main page so I tried to pass the values from the search to the index. the error gives in line 35 of the index of the main page with the code:       @foreach (var item in Model) I'm doing a movie sales store, and...
asked by 12.05.2018 / 00:29
1
answer

Asp.Net MVC binding view model with a List

I'm trying to make a binding of my view, but when action is called my ViewModel queue comes with the ViewViewModel.Validates to null. I've tried it with    @Html.Hidden ("Code", validator.Code) , but it's not going. My view....
asked by 17.04.2018 / 15:42
1
answer

Default Value Set @Html.DropDownListFor via Json - ASP.NET MVC5

I'm doing a time-stamping page using ASP.NET MVC5. The user enters the marking data according to the print below: However,incaseofanerrorintheregistrationofthetag,thecontrollerreturnsthemodeltoviewwiththedataenteredbytheuser,usingtheconceptofmo...
asked by 21.02.2018 / 02:25
1
answer

Problem with form submission

I'm having trouble trying to make a submit of a form when my object is null as it is not mandatory. But you can not save it null. /// Model public class Atividade { public virtual long Id { get; set; } [Display(Name = "Descrição")]...
asked by 22.02.2018 / 17:52
1
answer

Foreign key entity framework asp.net mvc

I have My Table Repair and RepairDetails and I am getting the following msg when I try to update my migration: "The introduction of the FOREIGN KEY constraint 'FK_dbo.ConsertDetalhes_dbo.Pecas_PecasId' in the 'FixDetails' table can cause cycles...
asked by 02.02.2018 / 16:38