Questions tagged as 'razor'

2
answers

Apply selected on a select with Razor

I have the following code in a file with cshtml extension: @Html.DropDownList("TipoIdentificacionId", null, htmlAttributes: new { @class = "form-control" }) With which I load in a select a list that comes from the database, this does it wel...
asked by 16.05.2018 / 23:02
1
answer

ASP.NET MVC: Save an int variable from a select query on sql server

My problem is as follows. I have a code for a login, where I keep the username of the user who logged in Session["USERNAME"] . What I'm trying to do is put in my variable wea the ID of the user who just logged in using his username...
asked by 18.04.2018 / 04:18
0
answers

C #: Date format error in wGrilla.GetHtml

I have an error in the following line of code: Model.wGrilla.Column(format: (item) => Html.Raw(item.BIRTHDATE.ToString("dd/MM/yyyy")), header: "FECHA") The error message you show me is this:    The best overloaded method match for  ...
asked by 22.03.2018 / 22:28
0
answers

Does anyone know what happens with my Layout in ASP .NET?

See, I have a problem. I have configured my file "BundleConfig.cs" to minify my styles and scripts in production. At this moment I am in the development environment. My application had some performance problems by the dependencies. At first...
asked by 14.03.2018 / 00:54
3
answers

How can I make a Vista pass a ListModels to a controller? One of the fields of the Model is loaded by the user in the view

I have a view that corresponds to a survey. It is loaded with the questions and at the same time in the last column has a DropDowList with the possible answers. The problem I have is that I can not get my controller to receive the data of the qu...
asked by 13.03.2018 / 14:49
1
answer

How can I verify that the URL is correct?

Good I am breaking my head with this situation and I do not even know where to start. I have a list of valid URLs for an input, let's say 10 url from where users can enter links in an input, what I'm looking for is that if the user enters a link...
asked by 28.02.2018 / 20:19
2
answers

How to protect access to pages in MVC?

I have an application in MVC which has several pages (Views). The homepage is an authentication, which requires username and password. What I need is to protect all the pages (cshtml) so that it is not possible to access without going through...
asked by 20.10.2017 / 21:43
1
answer

Filter records with dropdownlist

Good morning comrades I am trying to filter the records by means of a dropdownlist but at the moment of clicking the button it only refreshes the page but does not do any search. controller public ViewResult Index(string estado, int? pa...
asked by 03.11.2017 / 19:02
1
answer

ASP .NET MVC Form with field "Image" - Load an image in the "View" and insert it into the DB

I have configured the connection to the database for the "Events" table Which generates me the fields in the model, and in the Image field transforms it to type "byte" public byte[] Imagen { get; set; } In the view I have the "Ima...
asked by 23.10.2017 / 02:48
1
answer

How can I resize the images before they are uploaded to the server? RAZOR - C # - WebMatrix [duplicated]

What I need is that the images before being uploaded to the server are compressed as much as possible in size in kb or mb, I do not know if this is achieved by changing its size in px before being uploaded, and at the same time Print a pre-def...
asked by 05.09.2017 / 18:12