Asp.net mvc html melper
        Posted  
        
            by tom
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by tom
        
        
        
        Published on 2010-06-14T21:00:48Z
        Indexed on 
            2010/06/14
            21:02 UTC
        
        
        Read the original article
        Hit count: 216
        
ASP.NET
|asp.net-mvc
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());
    }
© Stack Overflow or respective owner