How to refer to external JS files properly?

Mar 31, 2009 at 5:54 PM
Hi, I have a control that I am building and am using the PartialUpdatePanel. One of the user controls that I would like to pull in has references to 5 external Javascript files, however, only the first one seems to work.
I have the following in my codebehind in the Page_Init function:

  ScriptManager.RegisterClientScriptInclude(Page, Page.GetType, "jquery.jqGrid.js", Request.ApplicationPath & "/js/jQuery/jqGrid-3.4.3/jquery.jqGrid.js")

            ScriptManager.RegisterClientScriptInclude(Page, Page.GetType, "jquery.tablednd.js", Request.ApplicationPath & "/js/jQuery/jqGrid-3.4.3/js/jquery.tablednd.js")

            ScriptManager.RegisterClientScriptInclude(Page, Page.GetType, "jqModal.js", Request.ApplicationPath & "/js/jQuery/jqGrid-3.4.3/js/jqModal.js")

            ScriptManager.RegisterClientScriptInclude(Page, Page.GetType, "jqDnR.js", Request.ApplicationPath & "/js/jQuery/jqGrid-3.4.3/js/jqDnR.js")

            ScriptManager.RegisterClientScriptInclude(Page, Page.GetType, "DefaultContent.ascx.js", ControlPath & "DefaultContent.ascx.js")

I tried to review the rendered page code, but everything within the control just shows the viewstate. So, to see what's been loaded, I added the following to the codebehind:
            Dim colScripts As System.Collections.ObjectModel.ReadOnlyCollection(Of System.Web.UI.RegisteredScript) = ScriptManager.GetCurrent(Page).GetRegisteredClientScriptBlocks
            For Each scriptBlock As Web.UI.RegisteredScript In colScripts
                scriptBlocks.Text = scriptBlocks.Text & "<p> url: " & scriptBlock.Url & "</p>"
            Next

The output on this label shows this:
Registered Script Blocks

url: /DNN5/js/jQuery/jqGrid-3.4.3/jquery.jqGrid.js

url: /DNN5/js/jQuery/jqGrid-3.4.3/js/jquery.tablednd.js

url: /DNN5/js/jQuery/jqGrid-3.4.3/js/jqModal.js

url: /DNN5/js/jQuery/jqGrid-3.4.3/js/jqDnR.js

url: /DNN5/DesktopModules/Healthcomp.xEDI/UserControls/DefaultContent.ascx.js

However, I also added an alert on each of these files to the effect of alert("#1 jquery.jqGrid.js); with the number changing with the load  order. When I render the page, I only get one alert however and none of the javascript seems to function.
I have tried this about a million different ways and I just can't seem to figure it out. I completely stripped everything and rebuilt a new control with everything minus the PartialUpdatePanel and everything works fine.

Can anyone please offer me some insight as to how I may be able to use this?
Mar 31, 2009 at 6:13 PM
I changed from ClientSide loading to ServerSide loading on the control and I now am seeing all my alerts. Can someone please detail these two options or show me where I can find out.
thanks so much!