By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

Re submitting to the same form

P: n/a
Hi,

I'm building a web form utilizing ASP.NET and VB.NET. The web form has three
pages:
1. The first page has a set of text boxes that a user has to fill out and
then hit the next button. Once this is done the form has to resubmits to
itself and if all the required data is entered it displays the next page.
2. The second page is another input screen. When the user has completed
filling out the required fields on the page the user hits a submit button and
the form resubmits to it self and stores a set of data to a database. The
form then moves on to display the next page.
3. The third page displays some output text to the screen including thankyou
details.

Please note I want the form to resubmit to the same page.

I have a good background in ASP (have built similar online applications
before in ASP) also have read 'Essential ASP.NET' by Fritz Onion (loved it -
has helped me so much) also have just grabbed 'ASP.NET unleashed' by Stephen
Walther.

Here is the question.
How do I move through these screens with ASP.NET. Or another way to ask the
questions how do I display the different page formats after the user has hit
the next and submit buttons (and possibly previous with the second page). I’m
very confused with the framework requirements. Could someone please help?

Thank you in advance,
George.

Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The simple and prescribed way of doin this is to actually only use one
aspx page.

Have three panels on this page, by default have panel 1 set to visible
and 2 and 3 set to not visible,

Panel 1 contains the first input controls, panel 2 contains the second
etc. etc.

Then when you do a post back (when the first panel is visible) simply
make the first panel not visible and the second visible,

On the second post back (check if the second panel is visible to test
if it is the second postback), save the state to the DB, the state from
the first input will still be in the control collection.

Finaly display the third panel (making 1 and 2 not visible)

Nov 19 '05 #2

P: n/a
Hi George,

Postback is the standard behavoiur of asp.net pages for the majority of web
control events (if not all) such as a button submit on a web form. During the
postback you can perform the necessarry form validation or have validation
controls do this for you and then transfer the user to trhe next page if
validation passes. You can use the Response.Redirect(), Server.Transfer() or
Server.Execute() methods to do this which are similar to those is ASP. Each
has their own pros and cons so it's worth checking the MSDN. Generally
Response.Redirect() is probably the easiest but will involve and additional
round trip between the client and server and form post details will be lost
during the redirect.

Hope this helps, Andy

"geodev" wrote:
Hi,

I'm building a web form utilizing ASP.NET and VB.NET. The web form has three
pages:
1. The first page has a set of text boxes that a user has to fill out and
then hit the next button. Once this is done the form has to resubmits to
itself and if all the required data is entered it displays the next page.
2. The second page is another input screen. When the user has completed
filling out the required fields on the page the user hits a submit button and
the form resubmits to it self and stores a set of data to a database. The
form then moves on to display the next page.
3. The third page displays some output text to the screen including thankyou
details.

Please note I want the form to resubmit to the same page.

I have a good background in ASP (have built similar online applications
before in ASP) also have read 'Essential ASP.NET' by Fritz Onion (loved it -
has helped me so much) also have just grabbed 'ASP.NET unleashed' by Stephen
Walther.

Here is the question.
How do I move through these screens with ASP.NET. Or another way to ask the
questions how do I display the different page formats after the user has hit
the next and submit buttons (and possibly previous with the second page). I’m
very confused with the framework requirements. Could someone please help?

Thank you in advance,
George.

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.