Use this code
<script runat="server">
void button_click(Object s, EventArgs e)
{
if (ds_user.RecordCount == 1)
{
Response.Cookies["ckuser"].Value = txtusername.Text;
Response.Cookies["ckuser"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("home.aspx");
}
}
</script>
You can fill the Dataset "ds_user" with this valid user check result. This will have 1 record if the username and password matches
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
Offline 645 posts
since Dec 2006