Click to See Complete Forum and Search --> : Creating a Wizard type page in ASP.NET


TSmooth
August 9th, 2005, 07:41 PM
I would like to creat a web page that emulates a "wizard" type windows application. I would like to have about 3-4 steps in this "wizard" and have a Back and Continue button on the bottom of each steps display. Each step consists of a table with several input controls in the table. What is the best way to achieve this concept? I am trying to avoid having 3-4 separate .aspx's because then I'd have to maintain a bunch of session variables for all of the back/continue functionality and each step is based off data input from the previous step. I want to take advantage of the viewstate being maintained.

One way I thought may be possible is if I could modify the querystring when the "continue" button is clicked and have the page post back to itself with the new query string. This would then allow me to use several <%if ... else if... end if%> branches to display the proper inputs based on the query string value. Is this possible? I feel like there should be a better way to do this.

Please let me know your thoughts. I'm fairly new to ASP.NET so I apologize if this is an easy question.

enfekted
August 9th, 2005, 11:09 PM
I would avoid using <%if %> blocks in your aspx code. It will get very confusing very quickly. A better idea would be to have four <asp:panel> objects (one for each step) and make them visible one at a time when the Next or Previous button is clicked.