Adding Controls Programatically

Posted by Mike Keller on Stack Overflow See other posts from Stack Overflow or by Mike Keller
Published on 2010-04-23T15:09:38Z Indexed on 2010/04/23 15:13 UTC
Read the original article Hit count: 191

Filed under:
|
|

I have a page I need to build out where depending on the selection the user made on a form on the page prior it displays a different set of questions for them to answer.

So say the user selects Reason A from the form on page edit, then it needs to display Questions 1 and 2 on page edit_confirmation. But if they select Reason B then it needs to display Questions 3 and 4.

I'm grabbing the reason code from the query string and have a switch statement set up, but I can't find anywhere how to output different controls. If Questions 1 and 2 are supposed to show up, one could be a text box and the other a checkbox, but if questions 3 and 4 are supposed to show up one may need to be a dropdown list and a checkbox.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c#