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?
A web design workflow is a collection of processes that cover every step involved in creating a website. It doesn't simply take into account the actual design process, it encapsulates everything from the preparation stages right through to post-launch.
A workflow is a system for managing repetitive processes and tasks which occur in a particular order. They are the mechanism by which people and enterprises accomplish their work, whether manufacturing a product, providing a service, processing information or any other value-generating activity.
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#S3
2, 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.
For these kinds of situations, I have used multiple panel controls to hold the various steps of the process. Set the visible property to display the UI for the portion you want the user to see.
You might also want to look at the Wizard Web Server Control which handles the plumbing for navigating between the steps of the process. To get some ideas on how the control works, take a look at The ASP.NET 2.0 Wizard Control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With