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. Dynamic creation of child control, timing problem with events

Dynamic creation of child control, timing problem with events

Scheduled Pinned Locked Moved ASP.NET
questionhelp
1 Posts 1 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.
  • C Offline
    C Offline
    Chris Richner
    wrote on last edited by
    #1

    Hi, I've got just one page class (aspx) which serves as the one and only base template page for the project. This page (default.aspx) now should load controls dynamically into a placeholder. Our navigation structure has 3 levels, means that we have 3 different controls which can be a part of the key what to load into the content section. Each navigation level uses the ID of the parent navigation item to decide which data should be loaded, at the end of the day the content section should load a specified UserControl. Level 1 (Products) -- Level 2 (ProductType) ----- Level 3 (ProductRating) -------- Content Frame (ProductRatingFrameControl) These given menu controls (3rd Party) use events to tell us about changed selections after a postback. But the events come very late, after OnLoad or CreateChildControls. As far as i know, it's only valid to create and add controls to a page during OnInit, CreateChildControls or OnLoad, if i try to create and add the controls in PreRender, they loose track of their ViewState stuff... So, now that's my problem, it's like a timing problem... the needed status data comes too late, i guess OnPreRender it's to late to add some dynamically created controls based on a user selction to the page, right? How can i solve such a mess? myMsg.BehindDaKeys = "Jerry Maguire";

    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