hai all, i am using c#.net, i want to store a value in a cookie and want to get it at when i needed. i used the following code
to set
to get
but it is not working
plz help me,
thanx in advance
to set
Code:
HttpCookie cook = new HttpCookie("UserInfo"); cook.Values.Add("USER_NAME", txtUserName.Text.Trim()); cook.Values.Add("PASSWORD", txtPassword.Text.Trim()); Response.AppendCookie(cook);
Code:
if (Request.Cookies["USERNAME"] != null && Request.Cookies["PASSWORD"] != null) { txtUserName.Text = Request.Cookies["USERNAME"].ToString(); txtPassword.Text = Request.Cookies["PASSWORD"].ToString(); }
plz help me,
thanx in advance
Comment