Note: By workflow i’m not referring to workflow technology, such as Workflow foundation.
All too often I find myself being required to design pages that flow through a series of steps.
1) Select from a set of options. Submit.
2) Populate a page with results. Make changes. Submit.
3) Do something based on the previous results. Submit.
4) Confirm previous actions. Submit.
5) Goto 1.
An ecommerce site with shopping cart would be a textbook example of this.
Now, there are any number of ways to deal with this. My question is, what is the recommended way to do it in asp.net? In PHP or ISAPI I would just use standard html controls, get the post data and do stuff with it, each on a different page.
ASP.NET seems to be more oriented towards single page solutions. Do your work, postback to yourself, then display your results in the same page.. moving along until the end, using something like a MultiView or UpdatePanels to do the job. But the key being, you don’t postback to another page.
Now I understand that Microsoft has added cross-page postbacks to .NET in recent versions, but this seemss less baked and kind of cumbersome. It’s difficult to work with data that was posted back unless you expose it via properties or something from your previous page.
How do you handle the scenario I layed out above? Do you use a multi-view or updatepanel and do it all in one page? Or do you do it in several pages? What is your best practices in this regard? Do you have any specific designs you tend to use? How do you go about structuring the sites workflow?
there are a number of ways of doing it (besides multi-view):
1, asp.net dose support action post, goggle
Page.Request.Form[item]http://msdn.microsoft.com/en-us/magazine/cc164151.aspx#S32, you can save your temp data into database temp table, then when users go through each page all they need to do is reference the temp data ID in database. (Query String)
3, you will also be able to save your temp data as a object in your session, so all your pages in the “work flow” can reference the session, then making manipulation based on it.
after all, they all have pros and cons, it mainly depends on how complex your project requirements are.