Reputation: 991
I have a view which includes
<link href="<%=ScriptUrl.ToUrl("~/Content/App_Themes/Blue/Sales_Blue.css")%>"
rel="stylesheet" type="text/css" />
in the head section of the view
I have a class as follow which is referenced in the concerned controller :
namespace MVCTEMP.HtmlHelpers
.....
public class ScriptUrl
{
public static string ToUrl(string path)
{
return string.Format("{0}?v={1}", VirtualPathUtility.ToAbsolute(path), MvcApplication.Version);
}
}
Why do i get The name 'ScriptUrl' does not exist in the current context when i hit run ?
any help will be appreciated thanks deb
Upvotes: 0
Views: 95
Reputation: 2092
Your view should be
<link href="<%=MVCTEMP.HtmlHelpers.ScriptUrl.ToUrl("~/Content/App_Themes/Blue/Sales_Blue.css")%>" rel="stylesheet" type="text/css" />
Upvotes: 1