Asp.net mvc html melper
- by tom
Hi there
Ive got this function as a html helper which should write a javascript function onto the page, I then call this in the masterpage like this <%Html.RenderBaseUrlScript(); %
My problem is that the script never seems to be written to the page, I search in the source and cannot see it anywhere, I have tried moving this around from the head to the body of the html masterpage, Im really confused as to why this is not workung, please help
public static string RenderBaseUrlScript(this HtmlHelper helper)
{
return string.Format("<script type='text/javascript'> $.url=function(url){{return '{0}'+url;}}", GetBaseUri());
}