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

1
answer

Data is lost in the Controller - View - Controller process

I told you that I have 2 controllers, one for the GET and another for the POST that I am going to edit so that it is easier to understand: // GET: Compras/Create public ActionResult Create(int id) { ComprasCreateModel compra = new...
asked by 25.11.2018 / 07:20
1
answer

How to export to Excel data from a table (datatable) asp.net mvc 5

This is on my table I need to send to excel This is a part of my view <div class="panel panel-flat"> <div class="panel-heading"> <h5 class="panel-title">Tipo Planilla:<strong> @ViewBag.FrecuenciaPag...
asked by 15.11.2018 / 21:25
1
answer

ERROR: Another SqlParameterCollection already contains SqlParameter

I'm using SqlParameter, when I use it twice I get this error: {"Otro SqlParameterCollection ya contiene SqlParameter."} Here I use it the first time: SP2 using (ApplicationDbContext db1 = new ApplicationDbContext()) {...
asked by 28.10.2018 / 01:13
1
answer

How to change website URLs to be friendly?

At this moment I have to implement some SEO improvements in the portal that I developed, among them they ask me to change the URs so that they are more friendly. Is there any way to do it that does not involve changing all the names to the co...
asked by 08.04.2016 / 15:04
1
answer

Method to edit does not work ASP.NET MVC 5

I am working in a web application of a car dealership, I have a view to edit the object of type Automovil that has the following parameters: model, year of manufacture, color, price, transmission, fuel, brand, model, category , state, extra and...
asked by 06.04.2016 / 04:37
1
answer

use foreach in a mvc view

   In the ViewBag.Deducciones : bring me the deductions you selected previously.       In the ViewBag.DeducesEmployees : it brings me the deductions that the employee has selected (). The problem is that for every deduction I go through a...
asked by 17.10.2018 / 22:19
1
answer

How to fill an Html.DropdownListFor ()?

I need to fill Html.DropdownListFor() in my view through razor, so far I have the following, two classes where I get the data that I need to recover from my db plus the controller by GET to recover the data and send it to the seen...
asked by 03.09.2018 / 16:23
1
answer

I can not make a Redirect towards an external url

I am creating an action filter to validate certain data in which, if followed, it follows the normal flow of the application, but otherwise it must be redirected to an external url. So far I have been doing tests and nothing has worked for me...
asked by 26.06.2018 / 15:09
1
answer

Confirm with data anottation a checkbox

I have a form that contains 9 input of type checkbox I need to validate that when sending the form at least one of them comes tickeado. I have the following in my view <div class="col-12 col-sm-6 col-md-3 li"> @Html....
asked by 29.06.2018 / 21:25
1
answer

Why does not the [DataType (DataType.Password)] work for me?

I have a model CredencialesViewModel which has a property Pwd type string add the decorator type data, but in the view does not render a input type password if not that one type text. / p> Why will this be?     
asked by 12.06.2018 / 21:43