Hi Dear if you are using TextBox controls for username and password you can follow this.
protected void btn_Click(object sender, EventArgs e)
{
HttpCookie cookie = new HttpCookie("UserName");
cookie.Values.Add(this.userName.Text, this.password.Text);
Response.Cookies.Add(cookie);
}
here is some javascript code
<pre>function readTheCookie() {
var the_cookie = document.cookie;
if (the_cookie != "") {
document.getElementById('<%=password.ClientID %>').value = the_cookie.split('=')[2];
}
}
[Removed begging for vote]
Thanks
Good Luck