You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jason Offutt edited this page May 2, 2013
·
6 revisions
Adding JS files to the page
If you're developing a block, and you need to register a JavaScript on the page in a way that will ensure that it does not get added more than once, there are a couple different ways to do it. We've exposed a method call on the CurrentPage object that will allow you to register your external JS file without worrying about collisions.
Under the covers, this method uses ASP.NET's built in ScriptManager control to handle registering all JavaScript with the current page, and will ensure the same script file does not get added to the DOM more than once.