Recently we discussed various facts about a Cookie. Today we will see that how a single cookie can store multiple values. First we will create a Cookie then we will store multiple values in the same Cookie. Also the important thing is to retrieve the all values of that cookies. Whether you can retrieve the values in the same variable of multiple variables.
Creating Cookie with Multiple Values:
Response.Cookies["empCookie"]["name"]= txtName.Text; Response.Cookies["empCookie"]["age"]= txtAge.Text; Response.Cookies["empCookie"]["Location"]= txtLocation.Text;
Retrieving multiple Cookies Value in single Variable:
We are going to Fetch the value in a single variable with comma(,) seperated value. string empdetails; empdetails = Request.Cookies["empCookie"]["name"]+","+Request.Cookies["empCookie"]["Age"]+","+Request.Cookies["empCookies"]["Location"];
Suggested Entry:
Cookies in ASP.NET
passing Multiple Values in QueryString
Development of software is only a single phase of overall system development. Coding is an important step on system development but maintaining the quality of software is also an important part and a challenging job. Proper testing is important for the good quality assurance. At present, there are different tools available for testing products. The tools like
Feedback
Comments
No Responses to “Cookies with Multiple Values in ASP.NET”Trackbacks