Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
56 Points
10 Posts
Apr 25, 2012 05:28 PM|LINK
you can set cookies like
Response.Cookies["Country"]["1"] = "US"; Response.Cookies["Country"]["2"] = "UK";
and loop through it like
if (Request.Cookies["Country"] != null) { int count= Request.Cookies["Country"].Values.Count;
for (int i = 1; i <=count ; i++) { Response.Write(Request.Cookies["Country"][i.ToString()].ToString()); } }
sagarbandal
Member
56 Points
10 Posts
Re: Multiple Values in a Single Cookie in ASP.net C#
Apr 25, 2012 05:28 PM|LINK
you can set cookies like
Response.Cookies["Country"]["1"] = "US";
Response.Cookies["Country"]["2"] = "UK";
and loop through it like
if (Request.Cookies["Country"] != null)
{
int count= Request.Cookies["Country"].Values.Count;
for (int i = 1; i <=count ; i++)
{
Response.Write(Request.Cookies["Country"][i.ToString()].ToString());
}
}