Page.ClientScript.RegisterClientScriptInclude
-
Hi all, I am using the above to register my scripts throughout my site. I have a couple that I want included on all pages so I am doing it on my master page, however, I have others that need to be included from the child pages. This isn't a problem in itself, but some of my child scripts need the master scripts to be included first. So when I register a script on my child page it puts the script before the ones registered by my master page. Is there a way to append the child script to the end of the registered script include block or will it always be placed at the begining in order of loading? Thanks for any help in advance. Mark
-
Hi all, I am using the above to register my scripts throughout my site. I have a couple that I want included on all pages so I am doing it on my master page, however, I have others that need to be included from the child pages. This isn't a problem in itself, but some of my child scripts need the master scripts to be included first. So when I register a script on my child page it puts the script before the ones registered by my master page. Is there a way to append the child script to the end of the registered script include block or will it always be placed at the begining in order of loading? Thanks for any help in advance. Mark
Are you using Page.ClientScript.RegisterClientScriptInclude in Page_Load event of the MasterPage? MasterPage, ContentPage Page event cycle differs. Use Page_Init event of the MasterPage instead of Page_Load.
Castle Rider My: Website | Yahoo Group | Blog Spot
-
Are you using Page.ClientScript.RegisterClientScriptInclude in Page_Load event of the MasterPage? MasterPage, ContentPage Page event cycle differs. Use Page_Init event of the MasterPage instead of Page_Load.
Castle Rider My: Website | Yahoo Group | Blog Spot
Yes I'm currently using Page_Load, I shall try Page_Init instead then let you know if it was successful. Thanks
-
Are you using Page.ClientScript.RegisterClientScriptInclude in Page_Load event of the MasterPage? MasterPage, ContentPage Page event cycle differs. Use Page_Init event of the MasterPage instead of Page_Load.
Castle Rider My: Website | Yahoo Group | Blog Spot
Yes it worked, thanks very much. Never occured it was to do with page load order, don't know why as it was quite obvious... Thanks again, much appreciated mark
-
Yes it worked, thanks very much. Never occured it was to do with page load order, don't know why as it was quite obvious... Thanks again, much appreciated mark
The following is the sequence in which events occur when a master page is merged with a content page: 1. Master page controls Init event. 2. Content controls Init event. 3. Master page Init event. 4. Content page Init event. 5. Content page Load event. 6. Master page Load event. 7. Content controls Load event. 8. Content page PreRender event. 9. Master page PreRender event. 10. Master page controls PreRender event. 11. Content controls PreRender event.
Castle Rider My: Website | Yahoo Group | Blog Spot