0

In razor template engine i'm using html helper class.

<div class="form-group">
    @Html.LabelFor(m => m.FirstName, new { @class = "col-md-2 control-label" })
    <div class="col-md-10">
        @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control" })
    </div>
</div>

I need to change Html class from System.Web.Webpage.Html to System.Web.Mvc.Html.

i added following configurations to view web.config file.

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing" />
        <add namespace="temp" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

it still comes from under System.Web.Webpage.Html. How can i change library to Mvc.Html helper?

erkan demir
  • 1,386
  • 4
  • 20
  • 38

0 Answers0