Questions tagged as 'razor'

1
answer

How to concatenate RadioButtons values in Razor / HTML?

I have a question and it's kind of hard to find a practical way to solve it. I created a groupbox with 10 radiobuttons . I would like to know the best practice so that when the user marks one of them I store this value in a varia...
asked by 03.04.2014 / 00:41
1
answer

How to get RadioButtonFor value through FormCollection and save in BD SQL Server

I have a model with several booleans, I need to get their values through a FormCollection and save them to the SQL database (it does not accept boolean, so the field is a bit). My View: <div class="editor-field"> @Html.Rad...
asked by 16.05.2014 / 21:36
1
answer

Text field does not take value asp.net MVC

I have a text field in my system called NomeEspecificacao , but when I fill in any value in it, it is always returned null in my Action, that is, the word that I write in the text field never comes. View Code: model SEMA.Fiscalizacao....
asked by 13.11.2018 / 15:57
1
answer

Razor - @ Html.DropDownList with dynamic name

I would like to concatenate the ID that I get from @Model in the string of the name property of Dropdownlist because I would like to treat them dynamically. I try to do @Html.DropDownList ("Name" + @ Model.Id) and it does not work. How c...
asked by 31.07.2014 / 20:01
2
answers

ValidationResult with two parameters

I'm trying to use custom validation, as explained in this link , but there I can only pass one parameter to validate, and I need both, because if the field is empty and the other is false, it has to either fill in the State Registration field o...
asked by 01.10.2018 / 14:05
1
answer

Razor MVC - When using @using (Html.BeginForm ()) fields do not stand in front of each other

I'm starting to study MVC + Razor and in basic CRUD example, I'm trying to put the fields in two columns, as if they were using in HTML. But my code only works if I remove the @using (Html.BeginForm()) . Using @using (Html.BeginForm(...
asked by 09.09.2018 / 16:46
1
answer

Error displaying accented words in View

Good afternoon, All words that have an accent on my system are being formatted wrong as in the example below:    Auto Inspection Where it was supposed to be an inspection car. How to solve this, knowing that I'm using C # with Razor an...
asked by 04.09.2018 / 19:52
1
answer

Validate date in editfor

I made a date mask and would like to know how I validate the date right there, ie, in the edit it does not accept data type: 23/16/9087 . This is my date editfor <div class="form-group"> @Html.LabelFor(model => model.dataNasc...
asked by 10.08.2018 / 23:06
1
answer

How to perform submit select list view for Controller?

I have the following code in my view: @using (Html.BeginForm("DataAniv", "Mailing", FormMethod.Post)) { <div class="form-group"> <label for="sel1">Selecione o mês:</label> <select class="form-contro...
asked by 02.08.2018 / 16:16
1
answer

Save form Razor

How can I make for my form not to do sumbit of the same form several times. I'm having this problem because some users are clicking save multiple times, not waiting for the update screen, so then you are saving multiple duplicate records. I f...
asked by 30.05.2018 / 22:25