|
-
October 19th, 2011, 12:56 AM
#1
session variable help?
I am tryting to create a session variable where I can store a previous page information if I move on to the next page.
For example, I selected bunch of ddls on Customer page, then moved on to Employer page.
w/o session varibles, the information on customer page would be gone.
I am trying to make it where the things i have selected will still appear when i come back to customer page.
Do you guys have any idea how to do this?
-
October 19th, 2011, 12:08 PM
#2
Re: session variable help?
If it's a multiselect listbox, I'd simply create a session variable, that had your selections, as a comma delimited string on the changed events, and doing a string split in your current page, and updating everything on the form-load of the new page.
-
October 19th, 2011, 01:57 PM
#3
Re: session variable help?
I'm assuming that this is for an ASP .NET application.
You can put objects straight into Session- you just have to cast them when you pull them out of Session.
The following example is for dealing with a List<string>
Code:
private List<string> m_StringList;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["StringList"] != null)
m_StringList= (List<string>)Session["StringList"];
}
private void AddStringToList(string item)
{
m_StringList.Add(item);
Session["StringList"] = m_StringList;
}
HTH
Code:
if (Issue.Resolved)
{
ThreadTools.Click();
MarkThreadResolved();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|