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

Topics: Writing modules
Oct 2, 2012 at 1: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?

Oct 3, 2012 at 12: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 10:41 AM

Ah, it seems that the overload I am using is only available since MVC 4:

Orchard is currently using MVC 3.

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