How to keep a session state

Posted on 2011-10-10
Medium Priority
Last Modified: 2012-08-14
I have a web page that allows user to pick a community and it list in a grid all the workorders associated with that community.  Then they can click a edit command and it takes them to another web page which shows them details of the work order and allows them to edit it.  My question is when they are done editing and I want to take them back to the first web page, how can I keep the list that is already in the grid and the community they selected without having them pick the community again.  
Question by:mgmhicks

Accepted Solution

vbigham earned 2000 total points
ID: 36943549
You can store session variables in the current session object (Asp pages usually supply a "Session" property that you can save items in a Key/Value type of arrangement.

' Access the session object statically '

' Store values '
Private MyWorkOrdersList As New List(Of WorkOrder)
Session("WorkOrdersList") = MyWorkOrdersList

' Retrieve Values from other pages (or the same) '
Private MyWorkOrdersList As List(Of WorkOrder)
MyWorkOrdersList = Trycast(Session("WorkOrdersList"), List(Of WorkOrder))

If MyWorkOrdersList IsNot Nothing Then
    ' Use the saved work orders '
End If

Open in new window

LVL 83

Expert Comment

ID: 36944216
As you are changing pages, you can use querystring as well. For example, you can use a


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question