Using built-in ASP.NET MVC Html Helpers in Views

Topics: Writing modules
Oct 2, 2012 at 2:29 PM

We are trying to do the following:

@Html.LabelFor(model => model.NewSection, new { @class = "control-label" })

But Orchard has overloads for these HTML helpers, none of which take extra attributes as parameters.

How can we use the built-in ASP.NET MVC Html helpers, which allow us to define the attributes?

Coordinator
Oct 3, 2012 at 1:15 AM

You can of course use the MVC helpers, just by including the right namespace, but they don't take extra attributes either.

Oct 4, 2012 at 11:41 AM

Ah, it seems that the overload I am using is only available since MVC 4: http://msdn.microsoft.com/en-us/library/hh833699(v=vs.108).aspx

Orchard is currently using MVC 3.

Ok, we will probably not use this Html-Helper for now.