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. Master Page Issue

Master Page Issue

Scheduled Pinned Locked Moved ASP.NET
helpquestion
3 Posts 3 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
    Mahesh J
    wrote on last edited by
    #1

    Hi... How can i perform the body Onload event of a content page, while using Master Page. Since there is only one body tag in the Master Page. Thanks in Advance Mahesh.J

    G N 2 Replies Last reply
    0
    • M Mahesh J

      Hi... How can i perform the body Onload event of a content page, while using Master Page. Since there is only one body tag in the Master Page. Thanks in Advance Mahesh.J

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Put an id and runat="server" in the body control so that you can reach it from code behind. Put a property in the master page that exposes the control publically, so that you can reach it from the content page. In the content page you have to cast the Page.Master property to the actual class of the master page to be able to reach the property in the master page.

      --- single minded; short sighted; long gone;

      1 Reply Last reply
      0
      • M Mahesh J

        Hi... How can i perform the body Onload event of a content page, while using Master Page. Since there is only one body tag in the Master Page. Thanks in Advance Mahesh.J

        N Offline
        N Offline
        Nimua
        wrote on last edited by
        #3

        Hello, You can add the following code to the aspx page <!-- function LoadPage(event) { alert('Load') } document.body.onload=LoadPage; //--> It's strange but it works only if you write rigth in aspx file, it did not work when I try to use RegisterStartupScript. I hope this will help you : )

        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