Questions tagged as 'asp.net-mvc'

1
answer

How to put quotation marks in a message

if(string.IsNullOrEmpty(pessoa.Nome)) { ModelState.AddModelError("Nome", "O campo nome é obrigatório"); } How do I put quotation marks inside the message? Eg: The "name" field is required.     
asked by 25.03.2018 / 03:24
1
answer

System.Collections.Generic.IEnumerable

Help, guys! I have tried to do everything, already includes "using System.Linq" and nothing. Anybody know? MedicosController using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Ca...
asked by 28.03.2018 / 21:21
1
answer

Error in expression

Can anyone help me with the following error? Here is my code below. I'm trying to fix this error, but I did not succeed. public IEnumerable<Dia1> GetPendenciasByUser(int centroId) { var query = Db.Dia1S .Join(Db.Cada...
asked by 22.03.2018 / 15:15
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

How to do to one or more field within the screen execute javascript function

I have a javascript function that should be executed when any of the two fields are made any kind of change. At first only the #DataAbate field when a change is performed runs the script but I want the #AntiValue to also execute the funct...
asked by 14.03.2018 / 23:02
1
answer

Problems Posting in a ViewModel to the Controller - Asp.Net Core 2 MVC

I have a ViewModel that I use to load data from a physical or legal person. It contains some properties like PeopleNature, among others, that I use to load my dropdownlists from my view. The problem is right between my view and my Create method...
asked by 09.03.2018 / 10:31
1
answer

Transpose object list [closed]

How can I transpose the columns of a table like the one in the image below For this format: Mercado | Semana 5 | Semana 6 FUT AUD | 0.9986 | 1.0035 FUT CAD | 1.0000 | 1.0062 FUT CHF | 1.0059 | 1.0158 I tested some implementation...
asked by 07.03.2018 / 15:17
1
answer

What is the "asp-fallback" in ASP.NET MVC, Razor Pages?

I see some files as lines similar to this: <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js"asp-fallback-src="~/lib/jquery/dist/jquery.min.js" asp-fallback-test="window.jQuery" crossorigin="anonymous"...
asked by 01.03.2018 / 01:56
1
answer

Action call as parameter in Html.BeginForm - ASP .NET MVC 5

I have a code that queries a WebApi, writes to the database, and queries the database, in this application, a view that has 3 buttons, namely: Query Ws Insert BD BD Query I'm using @ Html.BeginForm to submit the button action and call...
asked by 23.02.2018 / 18:43
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