Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC Preview 5 - Html.Image helper has moved namespace

We've just updated ASP.NET from Preview 3 to Preview 5 and we've run into a problem with the Html.Image HtmlHelper in our aspx pages.

It seems that Html.Image has moved from System.Web.Mvc into Microsoft.Web.Mvc, and the only way we've found to access the helper now is to add an import statement to every .aspx page that uses it. All the other helpers can be accessed with using System.Web.Mvc; in the C# codebehind of a view master page, but this one seems to need an <@Import Namespace="Microsoft.Web.Mvc"> in every .aspx page.

Does anyone know of a way around this?

like image 744
Sam Wessel Avatar asked Sep 22 '08 10:09

Sam Wessel


1 Answers

You can add the namespace to pages in System.Web in you web config.

<pages validateRequest="false">
    <namespaces>
        <add namespace="Microsoft.Web.Mvc"/>        
    </namespaces>
</pages>
like image 62
Paco Avatar answered Sep 22 '22 14:09

Paco