Thursday, June 19, 2014

Cookie Sample - Asp.net C#

Store Value


                    HttpCookie AppId = new HttpCookie("Admission");
                    AppId.Value = dtSid.Rows[0][0].ToString(); //or any value

                    Response.Cookies.Add(AppId);


Read Value From Cookie


                     HttpCookie AppId = Request.Cookies["Admission"];
                     String strSample=AppId.Value.ToString();

No comments:

Post a Comment