Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Page.ClientScript.RegisterClientScriptInclude

Page.ClientScript.RegisterClientScriptInclude

Scheduled Pinned Locked Moved ASP.NET
helptoolsquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    markymark82
    wrote on last edited by
    #1

    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

    V 1 Reply Last reply
    0
    • M markymark82

      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

      V Offline
      V Offline
      Venkatesh Mookkan
      wrote on last edited by
      #2

      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

      M 2 Replies Last reply
      0
      • V Venkatesh Mookkan

        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

        M Offline
        M Offline
        markymark82
        wrote on last edited by
        #3

        Yes I'm currently using Page_Load, I shall try Page_Init instead then let you know if it was successful. Thanks

        1 Reply Last reply
        0
        • V Venkatesh Mookkan

          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

          M Offline
          M Offline
          markymark82
          wrote on last edited by
          #4

          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

          V 1 Reply Last reply
          0
          • M markymark82

            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

            V Offline
            V Offline
            Venkatesh Mookkan
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups