remember me
-
hi, i designed a login page in asp.net with C#, in that i want to save the username and password in the local computer,if the user select the remember me in the computer checkbox means, the username and password must save in that computer. plz help me.
jai prakash
-
hi, i designed a login page in asp.net with C#, in that i want to save the username and password in the local computer,if the user select the remember me in the computer checkbox means, the username and password must save in that computer. plz help me.
jai prakash
Hey i have answered the same question below.
Regards, Satips.:rose:
-
hi, i designed a login page in asp.net with C#, in that i want to save the username and password in the local computer,if the user select the remember me in the computer checkbox means, the username and password must save in that computer. plz help me.
jai prakash
Take a checkbox in the login page i had used Logincontrol of asp.net2.0 CheckBox chkBox = (CheckBox)Login1.FindControl("RememberMe"); if (chkBox.Checked==true) { HttpCookie myCookie = new HttpCookie("myCookie"); //Instance the new cookie Response.Cookies.Remove("myCookie"); //Remove previous cookie Response.Cookies.Add(myCookie); //Create the new cookie myCookie.Values.Add("user", this.Login1.UserName); //Add the username field to the cookie DateTime deathDate = DateTime.Now.AddDays(1); //Days of life Response.Cookies["myCookie"].Expires = deathDate; //Assign the life period myCookie.Values.Add("pass", this.Login1.Password); } Getting after Cookie created u write the code in page load event.... if (Request.Cookies["myCookie"] != null) //Cookie Exists?? { HttpCookie cookie = Request.Cookies.Get("myCookie"); string user = cookie.Values["user"].ToString(); if (user != "") { Login1.UserName = user; //Write the username onto login username textbox } }
came out of hardwork