I tried porting some ASPX markup to Razor, but the compiler made a mistake.
ASPX (works great):
<% if (node.IsAccessibleToUser(Context)) { %>
<% } %>
CSHTML (throws an error):
@if (node.IsAccessibleToUser(Context)) {
}
Argument 1: cannot be converted from "System.Web.HttpContextBase" to "System.Web.HttpContext"
How to get a link to HttpContextin Razor mode? Is it correct to use HttpContext.Currentor do I need to check the visibility of the site map node in a different way?
altso source
share