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. Using Master Page as the DB reader which implements the reading on all child pages [modified]

Using Master Page as the DB reader which implements the reading on all child pages [modified]

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorialquestion
3 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.
  • S Offline
    S Offline
    shabya
    wrote on last edited by
    #1

    hello, i want to add a "hello ___" to all my pages. now , in order not to duplicate code , i can put it in the master page. in the master page i go and look for the user entered from the query string at the DB and put the name after the hello or Guest if i get null. this works fine. now, in the child pages i also want to use this DB output , so i use session to store the DB entry for later use by the child. my problem is that the child page's On_Load is performed prior to the Master page's On_Load and this causes the DB entry to be null before it was read by the Master page. does anyone have any idea how to solve this problem ? can i use the Page_Init in the master page for this ? is it acceptable and stable ? tnx, avi

    modified on Wednesday, April 22, 2009 3:54 PM

    T 1 Reply Last reply
    0
    • S shabya

      hello, i want to add a "hello ___" to all my pages. now , in order not to duplicate code , i can put it in the master page. in the master page i go and look for the user entered from the query string at the DB and put the name after the hello or Guest if i get null. this works fine. now, in the child pages i also want to use this DB output , so i use session to store the DB entry for later use by the child. my problem is that the child page's On_Load is performed prior to the Master page's On_Load and this causes the DB entry to be null before it was read by the Master page. does anyone have any idea how to solve this problem ? can i use the Page_Init in the master page for this ? is it acceptable and stable ? tnx, avi

      modified on Wednesday, April 22, 2009 3:54 PM

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      Use the Mater Page's Page_Init event to run the code. That event fires before the child pages load event.

      I didn't get any requirements for the signature

      S 1 Reply Last reply
      0
      • T ToddHileHoffer

        Use the Mater Page's Page_Init event to run the code. That event fires before the child pages load event.

        I didn't get any requirements for the signature

        S Offline
        S Offline
        shabya
        wrote on last edited by
        #3

        ok , tnx :)

        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