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

3
answers

What is Difference Between HTML.ActionLink vs. Url.Action?

Reading some tutorials from ASP.NET MVC I found these two helpers being used to do basically the same thing, which was to direct the user to a new view . Then I would like to know if there is any more noticeable difference...
asked by 28.03.2017 / 17:24
1
answer

TEnum not identified in html

I created the following helper: public static HtmlString DropDownListEnum<TEnum>(this HtmlHelper htmlHelper, string name, int? valorSelecionado = null) { List<SelectListItem> lstEnum = AttributesHelper.ToSelectList<T...
asked by 28.06.2016 / 20:10
2
answers

ASP.NET MVC - How to Change Name Attribute of TextBoxFor

Is it possible to change the field name generated by @Html.TextBoxFor ? I did not find anything in Portuguese related to that. I tried something like: @Html.TextBoxFor(x => x.ToDate, new { name = "to" }) If I do for example, for...
asked by 30.03.2017 / 21:04
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
1
answer

How to use Url.Action in a Helper Razor?

In an ASP.NET MVC5 project, I created a Helper inside the App_Code folder, however, when I use the Url.Action() function on my Helper the following compile error occurs:    CS0103: The name 'Url' does not exist in...
asked by 03.09.2015 / 16:17
1
answer

Delete space in the name of an input

It's the following, I'm doing a foreach this way. int count = 1; @foreach (var item in Model) { <input name="itemId_@count" value="@item.ProdutoId" type="hidden"> count++; } The problem is that in processing t...
asked by 31.05.2018 / 21:15
1
answer

ASP.NET Checkbox Problem "The parameter conversion from type 'System.String' to type 'System.Boolean' failed."

I'm having the following problem with a checkbox I have a checkbox list that loads dynamically (depending on the items that exist in the database a checkbox is generated). Currently I have only three items being ids 1, 2 and 3. Inside the sys...
asked by 09.06.2017 / 13:52