Adding controls after page render RRS feed

  • Question

  • User-1760114961 posted
    Hi there. I'm using asp.net 4.0 , and I'm building an application that has a collection of user input controls (text boxes, drop down lists, etc). Some controls will output (or not) depending on user input and associated database configuration. For instance, if user enters value A for control 1, control 2 will output...otherwise control 2 will be skipped, and control 3 will output. My original plan was to have a container control to add my controls to (where the controls', textchanged or selectedindexchanged events triggers my backend logic to decide which input control should output next). Trouble is that an exception gets thrown when I add the control to the container control because I'm not allowed to add controls after the page has been rendered. Is there a good solution? I've checked out the cascade control from the Ajax control toolkit, but web services are not an option. I also don't know mvc...in case that was a solution I've considered just outputting straight HTML into the container control, but then I feel like I lose the ability to connect the controls to their event handlers from the server side, and I'd like to avoid interacting too much with client side technologies Any help would be appreciated
    Saturday, June 23, 2012 10:06 AM