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. Event Management Solutions

Event Management Solutions

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorialquestion
5 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I am writing a Rendered Custom Control that will serve as a multiple page index for our application (similar to the standard next/previous buttons, with specific page links in between). The problem I'm having is that the control is going to be used on pages that render their own dynamic controls (links, etc) to other pages that come out of the database. When the control is rendered, the links on the parent page are not registered properly because the parent page needs to load it's links in the Page_Load method, whereas the multi-page control cannot tell the parent which items to load until the page has responded to its Click event - AFTER the Page_Load has long since finished processing. Is there anyway to register dynamic events on controls prior to rendering but after Page_Load, or conversely does anyone have a suggestion for storing the desired page information on the client so that it's retrievable at Postback? I've tried a hidden text box on the page, but since the text is rendered, I can't add it to the page's control collection and can't figure out how to get at it's data. I also tried using a hidden text box control in my multi-page controls CreateChildControls() method, but could never find the control after postback. This is moderately urgent - any help is GREATLY appreciated.

    A 1 Reply Last reply
    0
    • L Lost User

      I am writing a Rendered Custom Control that will serve as a multiple page index for our application (similar to the standard next/previous buttons, with specific page links in between). The problem I'm having is that the control is going to be used on pages that render their own dynamic controls (links, etc) to other pages that come out of the database. When the control is rendered, the links on the parent page are not registered properly because the parent page needs to load it's links in the Page_Load method, whereas the multi-page control cannot tell the parent which items to load until the page has responded to its Click event - AFTER the Page_Load has long since finished processing. Is there anyway to register dynamic events on controls prior to rendering but after Page_Load, or conversely does anyone have a suggestion for storing the desired page information on the client so that it's retrievable at Postback? I've tried a hidden text box on the page, but since the text is rendered, I can't add it to the page's control collection and can't figure out how to get at it's data. I also tried using a hidden text box control in my multi-page controls CreateChildControls() method, but could never find the control after postback. This is moderately urgent - any help is GREATLY appreciated.

      A Offline
      A Offline
      Alvaro Mendez
      wrote on last edited by
      #2

      Kerry MacLean wrote: Is there anyway to register dynamic events on controls prior to rendering but after Page_Load You would do it the same way it's done inside the InitializeComponent method. Kerry MacLean wrote: I've tried a hidden text box on the page, but since the text is rendered, I can't add it to the page's control collection and can't figure out how to get at it's data. Use Request["nameOfHiddenInputField"] to get its data. Kerry MacLean wrote: I also tried using a hidden text box control in my multi-page controls CreateChildControls() method, but could never find the control after postback. If you go this route, remember to override OnInit and call EnsureChildControls() in there. Regards, Alvaro


      You know what they say about arguing over the Internet...

      L 1 Reply Last reply
      0
      • A Alvaro Mendez

        Kerry MacLean wrote: Is there anyway to register dynamic events on controls prior to rendering but after Page_Load You would do it the same way it's done inside the InitializeComponent method. Kerry MacLean wrote: I've tried a hidden text box on the page, but since the text is rendered, I can't add it to the page's control collection and can't figure out how to get at it's data. Use Request["nameOfHiddenInputField"] to get its data. Kerry MacLean wrote: I also tried using a hidden text box control in my multi-page controls CreateChildControls() method, but could never find the control after postback. If you go this route, remember to override OnInit and call EnsureChildControls() in there. Regards, Alvaro


        You know what they say about arguing over the Internet...

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Thanks for the quick response! Alvaro Mendez wrote: You would do it the same way it's done inside the InitializeComponent method. Not sure what you mean here. All of my control output is taking place in the Render method, including registering the events with Page.GetPostBackEventReference(...). I suspect that I'm doing some unnecessary or difficult work here, but this is a new step to me. Alvaro Mendez wrote: Use Request["nameOfHiddenInputField"] to get its data. Thanks for that - this will be the first thing I try - it works will with what I've already got. Alvaro Mendez wrote: If you go this route, remember to override OnInit and call EnsureChildControls() in there. If either of the first two responses work, I hope I don't have to go here. :)

        A 1 Reply Last reply
        0
        • L Lost User

          Thanks for the quick response! Alvaro Mendez wrote: You would do it the same way it's done inside the InitializeComponent method. Not sure what you mean here. All of my control output is taking place in the Render method, including registering the events with Page.GetPostBackEventReference(...). I suspect that I'm doing some unnecessary or difficult work here, but this is a new step to me. Alvaro Mendez wrote: Use Request["nameOfHiddenInputField"] to get its data. Thanks for that - this will be the first thing I try - it works will with what I've already got. Alvaro Mendez wrote: If you go this route, remember to override OnInit and call EnsureChildControls() in there. If either of the first two responses work, I hope I don't have to go here. :)

          A Offline
          A Offline
          Alvaro Mendez
          wrote on last edited by
          #4

          Kerry MacLean wrote: Thanks for the quick response! You did say it was urgent. :-) Kerry MacLean wrote: Not sure what you mean here. All of my control output is taking place in the Render method, including registering the events with Page.GetPostBackEventReference(...). I suspect that I'm doing some unnecessary or difficult work here, but this is a new step to me. I meant that the code for registering events would be identical to the one found normally in the InitializeComponent method populated by the designer. Based on what you're trying to accomplish though, that probably won't work. If you haven't already, take a look at this link[^] which may help you straighten things out. Regards, Alvaro


          You know what they say about arguing over the Internet...

          K 1 Reply Last reply
          0
          • A Alvaro Mendez

            Kerry MacLean wrote: Thanks for the quick response! You did say it was urgent. :-) Kerry MacLean wrote: Not sure what you mean here. All of my control output is taking place in the Render method, including registering the events with Page.GetPostBackEventReference(...). I suspect that I'm doing some unnecessary or difficult work here, but this is a new step to me. I meant that the code for registering events would be identical to the one found normally in the InitializeComponent method populated by the designer. Based on what you're trying to accomplish though, that probably won't work. If you haven't already, take a look at this link[^] which may help you straighten things out. Regards, Alvaro


            You know what they say about arguing over the Internet...

            K Offline
            K Offline
            kmaclean
            wrote on last edited by
            #5

            Again, much gratitude. All this will take a while to digest, but at least I've got more directon :)

            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