Top "Html-helper" questions

Refers to the `HtmlHelper` class for ASP.

Using Html.ActionLink and Url.Action(...) from inside Controller

I want to write an HtmlHelper to render an ActionLink with pre-set values, eg. <%=Html.PageLink("Page 1", "page-slug");%> …

asp.net-mvc html-helper actionlink urlhelper html.actionlink
How to add custom data attributes and classes to `@Html.EditorFor`?

I want to add some custom attributes to the input generated by @Html.EditorFor, I tried the following: @Html.EditorFor(…

asp.net-mvc asp.net-mvc-4 html-helper razor-2
Equivalent for MvcHtmlString in ASP.NET 5?

Is there an equivalent for MvcHtmlString in ASP.NET 5 ? Otherwise, how can we render HTML output from my custom HTMLHelper …

html-helper asp.net-core asp.net-core-mvc
Show "NULL" for null values in ASP.NET MVC DisplayFor Html Helper

Is there a way to get an @Html.DisplayFor value to show "NULL" in the view if the value of …

asp.net-mvc razor html-helper
Html.CheckBox returns false if disabled, even if seleced

Hopefully an easy question for you asp.net mvc gurus: I have a checkbox, created like this: <%=Html.CheckBox("…

asp.net-mvc checkbox html-helper
How to Create a URL in Controller like HtmlHelper

TLDR: How can I create a URL in the Controller similar to how I can use the HtmlHelper to create …

cakephp html-helper cakephp-2.x cakephp-3.x
Exclude/Remove Value from MVC 5.1 EnumDropDownListFor

I have a list of enums that I am using for a user management page. I'm using the new HtmlHelper …

c# asp.net-mvc razor enums html-helper
MVC 3 - Html.EditorFor seems to cache old values after $.ajax call

This is a follow on from the following question: MVC 3 + $.ajax - response seems to be caching output from partial …

asp.net-mvc-3 jquery html-helper
MVC: Override default ValidationMessage

In the world of MVC I have this view model... public class MyViewModel{ [Required] public string FirstName{ get; set; } } ...and …

asp.net-mvc data-annotations html-helper
Boolean with html helper Hidden and HiddenFor

What's up with this? The viewmodel variable is a bool with value true. <%= Html.HiddenFor(m => m.TheBool) %&…

asp.net-mvc html-helper html.hiddenfor