Thank you for your question. You can follow the bellow code.
private void CustomizeLoginControl()
{
if (Request.Cookies["MyCookie"] != null)
{
TextBox userName = (TextBox)Login1.FindControl("UserName");
userName.Attributes.Add("value", Request.Cookies["MyCookie"]["username"]);
TextBox pass = (TextBox)Login1.FindControl("Password");
pass.Attributes.Add("value", Request.Cookies["MyCookie"]["password"]);
}
}
private void setRememberMe()
{
HttpCookie cookie1 = new HttpCookie("MyCookie");
cookie1.Values.Add("username", Login1.UserName);
cookie1.Values.Add("password", Login1.Password);
cookie1.Expires = DateTime.Now.AddDays(1);
HttpContext.Current.Response.AppendCookie(cookie1);
}
Thanks,
Mamun