Home

C# String Array Into Out Of Session

string[] MyArray = {"Hello", "There", "Cruel", "World"}

Session["MySession"] = MyArray

////////////////////////////////////////////////////////////

string[] MyArray = (string[])Session["MySession"]

Line 1 we create a simple array.

Line 2 we part the array into the session

Line 3 is the key. We declare string[] MyArray as a string array. I'm not quite sure why we put (string[]) in front of mysession. Obviously this says "oooh look, we gonna treat Session["MySession"] as a string array. But... why the brackets? Not to worry, it works.

Reader's Comments

Post Your Comment Posts/Links Rules

Name

Comment

Add a RELEVANT link (not required)

Upload an image (not required)

No uploaded image
Real person number
Please enter the above number below




Home
Admin Ren's Biking Blog