Looks like there is no easy way to do chain postback

A

antonyliu2002

By "chain postback", I mean postback to one page and then another and
another.

For example, I have page1.aspx, page2.aspx, page3.aspx, page4.aspx in
a survey application.

1. Users can only submit the survey on page4.aspx.
2. Users can *randomly jump* among these 4 pages through the
navigation menu at the top of each page.
3. User input from all 4 pages must be obtained and submitted.

I have done this project successfully using Session. That is, I put
user input into the Session object each time the user jumps from one
page to another. When one page has been done, a session key-value pair
is created, and later on checked when the user submits, if the expected
pair does not exist in Session, the user is forced back to that page.

I've read and tried a little bit about cross page postback of ASP.NET
2.0, using things like PostBackUrl, PreviousPage VirtualPath. But it
looks like if we want the flexibility as described by 1 through 3
above, ASP.NET 2.0 does not really make developers' life easier. What
do you guys think? Have I just missed some really cool trick of .NET
2.0 that handles this scenario?
 
M

Mikeon

I've read and tried a little bit about cross page postback of ASP.NET
2.0, using things like PostBackUrl, PreviousPage VirtualPath. But it
looks like if we want the flexibility as described by 1 through 3
above, ASP.NET 2.0 does not really make developers' life easier. What
do you guys think? Have I just missed some really cool trick of .NET
2.0 that handles this scenario?

I find it much easier to put all the steps of a multi-step process on
one page and use either panel controls to show/hide the required step.
You can also use the Wizard control which was created to handle this
scenario. Personaly I do not use the Wizard control because it is hard
to get the values of individual controls found inside of the templates.
I do not like to use the FindControl method - it is not compile-time
checked and that can be a major problem if you delete some controls
from the wizard.
 
A

antonyliu2002

Yes, I think MultiView is an option. But an option only when it does
not make the page excessively long. Otherwise, I guess it takes a long
time to load.

The FindControl method is still tedious in my opinion, given the
scenario I described and probably does not relax the server load
either.
 
M

Mikeon

Yes, I think MultiView is an option. But an option only when it does
not make the page excessively long. Otherwise, I guess it takes a long
time to load.

I do not like the MultiView for the same reason I do not like Wizard -
problem with getting the inner controls.
As for the page load time. Only visible controls get rendered to the
html that is sent to the user. In case of MultiView only one view is
visible at a time. The rest of the views may have an impact on the
ViewState though so you will have to check how it works for you.

Michal
http://vaultofthoughts.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top