I received the following question a few days ago but I’ve been so busy with billable work that I just haven’t had a chance to answer it until now. Actually, I’m still busy, but I hate letting these questions go for too long.
“Right now I am working on a project where I have to screen a user. This is a multi-step process. At the end of the process I store the data back to the system. Currently, I am storing all the options a user will select in a session variable and then finally using them at the last step. Can you please suggest a better way to store this temporary data that does not require using a session? This type of situation comes up a lot. We’ve used multiview to get it working. But this does not seem to be viable in all situations.”
If I had a multi-step process that I needed to complete, I’d probably use the ASP.NET Wizard Control, which is a lot like the MultiView control you mention. The main difference is that it handles the navigation between the views for you.
If your process requires you to navigate between separate ASPX pages, then you’ll probably want to do something with cross-page posting.
Frankly, I don’t find session variables to be all that evil. Your trade-offs are to either store all of the data on the page using hidden form variables or ASP.NET view state (using MultiView or Wizard controls), which makes the page heavier than it might otherwise be, or you need to store the information in session variables, which takes up memory on the server.
For most web sites the extra memory used on the server is not an issue because the site just doesn’t get that much traffic.
Unless we are talking about a 50-step process, storing the information in the page isn’t much of an issue either.
Since you never state what it is about the MultiView control that makes it not viable in all situations, I’m left puzzled. Seems like its cousin, the Wizard control, is exactly what you need. I’m guessing there is something you don’t understand about how these controls should be used.
Other post in ASP.NET
- ASP.NET GridView Edit All Rows At Once - October 30th, 2007
- Validating A WebForms Checkbox . . . - January 4th, 2008
- ListView and the DataPager - January 7th, 2008
- The case of the disappearing session variables - January 14th, 2008
- Storing a DataRow into a Session (server) variable - January 15th, 2008
- The point of a multi layer architecture - January 31st, 2008
- FormView Edit and Add - May 12th, 2008
- Virtual Files using HttpContext.RewritePath() - July 17th, 2008
- ASP.NET AJAX using JSON - Here's how. - August 4th, 2008
- SystemException: The trust relationship between the primary domain and the trusted domain failed - November 18th, 2008
- GridViews - Multiple Rows Per Record - December 17th, 2008
- Response.Redirect() executes too soon on the Server. - January 27th, 2009
- Tab Control ActiveTabIndex Lost on Postback - February 25th, 2009
- ASP.NET Application_Error Detecting 404's - March 2nd, 2009
- Infinite 302 Loop - How would you even know? - March 11th, 2009
- Unable to find connection...for object web.config - March 18th, 2009
- Dynamically Change class Attribute From ASP.NET - September 29th, 2009
- HttpContext.Items vs Session - October 12th, 2009
- Access a control by ID From Within a Databound Control - November 2nd, 2009
- GridView and Updating A Row Manually - November 4th, 2009
- Embedding Google Search Appliance Results in ASP.NET - November 5th, 2009
- ASP.NET Cross Domain Form Submission - November 11th, 2009
- ASP.NET Interview Questions For New College Graduates - November 12th, 2009
- ASP.NET Dynamic Validator - November 16th, 2009
- The Google Appliance and Forms Authentication - August 4th, 2010
- Prevent Postback on Buttons - October 11th, 2010
- Azure CDN Blob Storage Case Sensitive Issue - April 17th, 2012
- ASP.NET JSON and ViewState - September 25th, 2012
- Panel DefaultButton does not work - December 25th, 2012
- Why CSS ID selectors are Evil in ASP.NET Web Forms - February 26th, 2013
- Sorting the ListView in ASP.NET - March 5th, 2013
- Multi-Step Processing in ASP.NET - May 8th, 2013
- ASP.NET Web Design Software - May 15th, 2013
- Test Sending Email without a Server in ASP.NET - June 5th, 2013
- Tracking Down Performance Issues in ASP.NET - July 24th, 2013
- Unrecognized Tag Prefix or Device Filter ‘asp’ - July 31st, 2013
- WebServices – Error Handling - December 11th, 2013
- Converting a DataList to a ListView - December 25th, 2013