Questions tagged as 'asp.net-mvc'

2
answers

How do I apply a ZIP mask on a column of a DataTable using JavaScript?

I have a DataTable in my View Index that has the CEP column that needs to have a zip code mask (ex: 29780-000). Does anyone know how to do this using JavaScript? <table class="table table-hover table-bordered dataTable table-striped wid...
asked by 25.05.2018 / 22:38
1
answer

Upload Image, and Create a thumb of the same Image Asp.Net Mvc?

I have a class named image, where I have two attributes, UrlDaImagem , and UrlDoThumb , I can save the image, normal only I would like to create a Thumb for that same image, without having to make a new upload. Class: public cla...
asked by 05.11.2018 / 19:55
2
answers

Variable remains zero in a mathematical expression

My program looks like this: public void CalculaProporção() { decimal contagemSubida = 0 , contagemDescida = 0; int cSubida = 6, cDescida = 4, range = 10; contagemSubida += Convert.ToDecimal(cSubida*range/100...
asked by 01.11.2018 / 15:54
1
answer

Instantiating the database context in the controller

Hello, I have a question related to the instancing mode DbContext the controller. What's the difference between the two methods below instantiation? 1. private ApplicationDbContext _db; public ApplicationDbContext db { g...
asked by 07.02.2018 / 14:21
2
answers

Load a Dropdownlist based on an enum - Asp.net core

I have an enum PersonNature that relates to the Person table. I need to create a dropdownlist in my view that displays the list of PeopleNature (PHYSICAL AND LEGAL PERSON), including showing the personal nature related to the current record, acc...
asked by 27.02.2018 / 15:53
2
answers

Pass jquery parameters to Url.Action ASP.NET MVC [closed]

I'm having trouble setting up a URL with parameters. Until then I have been using @Url.Action , but the second parameter dataPesquisa is going null. I imagine that when the parameter passed directly to @Url.Action C # s...
asked by 31.10.2017 / 16:37
2
answers

Show error message when ModelState is not valid

When I submit the form it acknowledges that ModelState.Valid is invalid but when it returns View() does not show the error messages I put in Model . My Controller: [HttpPost] [ValidateAntiForgeryToken] public...
asked by 17.11.2017 / 13:30
1
answer

Get method with where customizable

I made WebAPI ( ASPNET with EF6 ) with support for Get() , Post() and Delete() verbs. At some point, I need to access certain values that are not returned by default by verbs, for example: The Request C...
asked by 12.03.2018 / 20:25
1
answer

Two actions for the same View

I have these two actions: public ActionResult Lista(int PessoaId, string Nome, string Twitter) { Pessoa p = new Pessoa(); p.PessoaId = PessoaId; p.Nome = Nome; p.Twitter = Twitter; return View(p); } public ActionResult...
asked by 21.03.2018 / 15:31
1
answer

Date format in asp.net mvc [duplicate]

I'm having problems with the date format in en in an asp.net mvc application. Where it displays error if the date is in the dd / MM / yyyy HH: mm format, and only lets the date if it is not formed MM / dd / yyyy HH: mm . Model [Di...
asked by 22.06.2017 / 13:44