At Page load event
//////Read Cookie
if(Request.Cookies["Cookiename"]!=null)
{
HttpCookie cok=new HttpCookie("Cookiename");
LblCookie.Text=cok.Value ;
}
//////
/////write cookie
HttpCookie cok=new HttpCookie("Cookiename");
cok.Value=txtUsername.Text;
Response.Cookies.Add(cok);
//////
//////Read Cookie
if(Request.Cookies["Cookiename"]!=null)
{
HttpCookie cok=new HttpCookie("Cookiename");
LblCookie.Text=cok.Value ;
}
//////
/////write cookie
HttpCookie cok=new HttpCookie("Cookiename");
cok.Value=txtUsername.Text;
Response.Cookies.Add(cok);
//////
0 comments:
Post a Comment