System.Web.Mvc.UrlHelper is null

Hi,

What could cause System.Web.Mvc.UrlHelper is null in ASPX inline code in MVC 3?

Thank you

Use:

UrlHelper url = new UrlHelper(HttpContext.Current.Request.RequestContext);

Best regards.

Thank you for reply.

But I am curious why Url.Content() suddenly not working, and Url object is null in ASPX inline code <% … %>?

Hi chanmy8,

I think there are something error in your MVC 3 project. You may create a new project and try again. If it has the same issue, please repair your VS.

Best Regards

Starain

Hi

Now, even I uninstall and reinstall VS 2010 only have MVC2 in machine, my old project which is in MVC2 also hit the same exception.

Any ideas?

Leave a Reply