Solved

Session String[] Array?

Posted on 2012-03-22
5
210 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syntax Error 2 62
Web site error 3 36
Output Caching in IIS 2 28
RLDC Reporting in Visual studio 11 13
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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now