Questions tagged as 'asp.net-mvc'

1
answer

How to insert records in different tables with EF core in asp.net core2?

I have three tables, one of users that relates one to many with a table, and that one is related to the table phone_type, my calendar table has the id_agenda, user_id, phone_type_id, phone. When I create my model I only have the properties of my...
asked by 31.01.2018 / 23:21
2
answers

Create a view from scratch

I'm working with ASP.NET MVC, I'm creating my views from scratch to pure html, creating an empty view creates me this. @{ ViewBag.Title = "Proveedor"; } <h2>Proveedor</h2> But when creating html code I do this @{ ViewB...
asked by 13.02.2017 / 17:29
1
answer

DropDownList cascaded

I have this code but at the time of changing the option of the first DropDownList I get the following error:    undefined in the second DropDownList -El controlador- public JsonResult ArticulosPorCategoria(int Id ) { var arti...
asked by 24.08.2016 / 00:17
5
answers

I try to open a modal but it does not work

Good day, I have a modal which when clicking on an image does not activate, the truth already check the code I can not find the error. The code I use is the same one that I had already used on another occasion but now it does not work for me. If...
asked by 09.06.2017 / 16:08
1
answer

Render a string with HTML elements?

My concern is that I have a string in my database in the following way: '<a href="#" id="Manuel">@Manuel</a>&nbsp;hola' When I have it in my model, it appears in the same way, and when I want to render the view it is shown t...
asked by 11.11.2016 / 19:07
2
answers

how to pass data from a controller to a view that is not yours?

For example I have the DeleteUsers driver whose view is DeleteUsers.cshtml and another where the driver is Users and the view is Users.cshtml what I want is to pass the value of ViewBag.Error in DeleteUsers (controller) to Users (Vista) for ther...
asked by 18.08.2016 / 19:16
2
answers

Duplicate files when uploading them in ASP.NET MVC

I have the following code which I use to register images and pdf's, the problem is that up to the moment when I register for example two different images I save 1 but 2 times. And in the case of the PDF what I want is for me to save only one for...
asked by 13.06.2017 / 20:00
2
answers

Create form for Model List

I have a Model called Question: public class Pregunta { public int id { get; set; } public string descripcion { get; set; } public int peso_id { get; set; } public List<int> roles_id { get; set; } public int dimension...
asked by 07.06.2017 / 17:04
3
answers

Get type of an entity framework property

Good morning, You would need to obtain, at run time, the corresponding property data type: foreach(string unaPropiedad in listColumnNames) { clsEntidad.getype().getproperty(unaPropiedad); PropertyInfo prop= prop.propertyType; Type...
asked by 23.08.2016 / 17:51
3
answers

Redirect a controller automatically from a view .cshtml

I have a mvc web application that requests as a homepage to verify your identification and if it is correct send to the main page, the action is correctly fulfilled using authentication Forms and redirects to this if you try to go directly v...
asked by 11.02.2016 / 19:11