We are in the process of updating the ASP.NET MVC 1.0 application to release 2.0, and some codes require the use of LinkExtensions, which requires the visualization of HtmlHelper. Although we know that some of the code does not correspond to the MVC model correctly and, if necessary, is transcoded, we need to work something for the application to be created.
Here is the current syntax that we have that works in ASP.NET MVC 1.0:
public static HtmlHelper GetHtmlHelper(ControllerContext context) { return new HtmlHelper(new ViewContext(context, new WebFormView("HtmlHelperView"), new ViewDataDictionary(), new TempDataDictionary()), new ViewPage()); }
The error we get is the following:
Error 1 'System.Web.Mvc.ViewContext' does not contain a constructor that takes 4 arguments
rjzii source share