Dynamically injecting javascript (GoogleMap API) in the markup page RRS feed

  • Question

  • User-1868908615 posted


    Spent too much time trying to figure out why this piece of vb.net is not injecting .js file in .aspx page:

            If Not Page.ClientScript.IsClientScriptIncludeRegistered("GoogleMap") Then
                Page.ClientScript.RegisterClientScriptInclude("GoogleMap", String.Format(ConfigurationManager.AppSettings("GoogleMapUrl"), ConfigurationManager.AppSettings("GoogleMapKey")))
            End If

    However I have no problems injecting .js with this approach:

            If Not Page.ClientScript.IsClientScriptIncludeRegistered("HtmlDecode") Then
                Page.ClientScript.RegisterClientScriptInclude("HtmlDecode", ResolveUrl("~/JS/HtmlDecode.js"))
            End If

    Any ideas, folks ? Thanks for your time. I'm using V3 of the Google Mapping API.




    Tuesday, September 28, 2010 10:11 PM


  • User-1868908615 posted

    Nothing wrong with the code, it seems to be working ;-) 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 29, 2010 1:44 AM