Solved

Session String[] Array?

Posted on 2012-03-22
5
211 Views
Last Modified: 2012-08-14
Q. How do I send & recieve a string[] in a Session?

string[] names = new string[3] {"Matt", "Joanne", "Robert"};

Session("nameArray") = names???
0
Comment
Question by:pointeman
  • 3
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
Umar Topia earned 500 total points
ID: 37751904
You can store anything in Session Varibale

However, while retrieving you will have to cast it in specific Type

string[] names = new string[3] {"Matt", "Joanne", "Robert"};

string[] strarrSessionNames = Session("nameArray") as string[];

or

string[] strarrSessionNames = (string[])(Session("nameArray"));
0
 
LVL 10

Expert Comment

by:Umar Topia
ID: 37751913
for storing it's a simply statement

string[] names = new string[3] {"Matt", "Joanne", "Robert"};

Session["nameArray"] = names;
0
 

Author Comment

by:pointeman
ID: 37755157
Okay, then access the info like:

string matt  = names[0].ToString();
string joanne  = names[1].ToString();
0
 
LVL 10

Expert Comment

by:Umar Topia
ID: 37755517
Yeah... once you get the array object
then you can play around with it in normal way
0
 

Author Closing Comment

by:pointeman
ID: 37759364
thx
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

790 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