Web Control - How to control Javascript Injects? RRS feed

  • Question

  • User-1039916546 posted

     If I write a control that will inject Javascript, is there a way to tell if the same control is used twice on the page and only inject the Javascript once?  The only way I can see is to move the Javascript to a external JS file, but then the user must add that to the page to get the control to work.

    My control doing a simple process using Googe maps, but I do not need the maps script injected more than once.




    Thursday, April 3, 2008 2:59 PM


  • User-16411453 posted
     You check it against the script manager
    If (Not cs.IsClientScriptIncludeRegistered(rsType, "vertical_MenuControl")) Then
    	cs.RegisterClientScriptInclude("vertical_MenuControl", cs.GetWebResourceUrl(rsType, "ice5software.Menu.vertical_MenuControl.js"))
    End If



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 4, 2008 5:51 PM