Questions tagged as 'razor'

1
answer

Display an EnumDropDownListFor a condition

How do I display EnumDropDownListFor as a condition? For example, if the user wishes to report their sexual orientation, enum is displayed. Otherwise it is not displayed.     
asked by 15.05.2017 / 01:36
0
answers

Link sends null array

I have a search screen and need to send a parameter as array, that part was quiet, the big problem is that this screen is paged, so in the page change links I put to send this parameter, but it is always sent null. Codes:    Controller...
asked by 05.10.2016 / 16:08
0
answers

Use two CSS classes in C # Razor MVC [closed]

I'm wanting to use two CSS classes in Razor. Is it possible to do that? Because I can not. I'm doing the following: <div class="form-group"> @Html.LabelFor(model => model.ativo, htmlAttributes: new { @class = "control-l...
asked by 27.09.2016 / 19:01
0
answers

DropDownList with data from an Enum

I need to do a Helper where I pass an Enum and it mounts a DropDownList based on all Enum values, I tried to do it as follows: C #: public static HtmlString DropDownListEnumFor(this HtmlHelper htmlHelper, Type _enum, string name, int value)...
asked by 24.06.2016 / 12:46
2
answers

Getting record id

I have a table with several records and a delete link, how do I, when I click on this link, pass the value of the record id I want to delete? Code of my view: @model IList<Financas.Entidades.Usuario> @Html.ActionLink("Novo Usuário", "Fo...
asked by 21.06.2016 / 04:05
1
answer

Highlighting does not work in Razor MVC 5 views

I'm having a Razor ASP.NET MVC 5 project that was built on VS2013 on another computer. When loading it on my computer with VS2012 the highlighting and IntelliSense Views (cshtml) do not work. I noticed that my VS2012 did not have MVC 5, if I...
asked by 21.07.2016 / 15:53
1
answer

Upload information _Layout.cshtml database welcome

I want to load the information in _Layout.cshtml as registered in the database, for example, @ViewBag.MetaDescription , @ViewBag.MetaKeywords , @ViewBag.Title and other information also coming from the database. What...
asked by 04.05.2016 / 22:01
2
answers

@ Html.DropDownListFor Default item in the first list values

Good afternoon, gentlemen. I use DropDownListFor to load lists, example load all my clients to be selected. However, I need that if a record does not appear in the listing have the option to add a new item. I can write the code, how...
asked by 17.12.2015 / 21:30
2
answers

validation for PartialView

I have a page that calls a partialview formed by a div with text field into it, through a button. Each time the button is pressed a line is added. The problem is that I can not validate the empty fields of this partialview. I use @Html.Val...
asked by 23.09.2015 / 21:18
2
answers

HTML Tag in Helper Razor

I have HTML code: <label class="labelinput">Nº Compra<em>*</em></label> Moving on to Helper ran as follows: @Html.Label("Nº Compra:", new {@class = "labelinput"}) But I could not add the <em> tag to...
asked by 11.09.2015 / 15:35