georges619 georges619 - 1 year ago 92 Question

Dynamic Form ASP.NET VB.NET

I'm searching for 2 day how to create a dynamic form using ASP.NET and Visual Basic. I'm going to explain my problem;

  • I have 3 different forms because on each form there are 3 radio

  • I also have a main form that is loaded when I launch my program.

  • When I click on the first radio button, the 1st Form is loaded.

  • When I click on the second radio button, the 2nd Form is loaded.

  • And also the same thing with the third radio button (form 3 is loaded)

My question is : Is there a possibility to create a Dynamic Form where all the 3 form are integrated ? I mean, if I click on radio button 1, the fields corresponding to this button are loaded. If I click on radio button 2, the fields corresponding to radio button 2 appears and the other fiels (corresponding to radio button 1 disappear).

If you have some solutions or some links would be great.

Thanks for your help.

Answer Source

Use a series of <asp:Panel> elements. These will render as HTML <div> elements. They all have a Visible property. Each one should contain the different sets of form elements that you want to be visible. In your code behind you can set the panels' Visible property True or False depending on which radiobutton was chosen by the user. In that way you can have one form, but where different parts of the form are displayed in different circumstances.