Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a string array and it is filling by database and i want to assign its[string[] array] values to a cookie. Please Paste some code.
My code is --
C#
Array ar_Driver = (Array)fn.Arr_Driver();
HttpCookie Driver = new HttpCookie("Driver");
Driver.Value = Convert.ToString(ar_Driver);
Driver.Expires = DateTime.Now.AddHours(1);
Response.Cookies.Add(Driver);
Posted
Updated 9-Sep-11 21:23pm
v2
Comments
Wendelius 10-Sep-11 3:23am    
Pre tags added

1 solution

Cookies only hold a string: so you would need to convert your string array to a single string and back again.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900