Try this for login....:)
protected void btnLogin_Click(object sender, EventArgs e)
{
if (txtUsername.Text != "" && txtPassword.Text != "")
{
RegistrationUser Dataservice = new RegistrationUser();
DataTable dtGetlogDetail = Dataservice.GetLoginDetail(txtUsername.Text, txtPassword.Text);
if (dtGetlogDetail.Rows.Count > 0)
{
if (dtGetlogDetail.Rows[0]["confirmed"].ToString() == "1")
{
Session["User"] = Convert.ToInt32(dtGetlogDetail.Rows[0]["id"]);
Response.Redirect("~/Customer/ClientIndex.aspx");
}
}
else
{
Response.Write("<script>alert('Please enter valid Password or Username.')</script>");
}
}
}
Try this for Loguot....:)
protected void btnLogOut_Click(object sender, EventArgs e)
{
if (Session["User"] != null)
{
Session.Clear();
Session.Abandon();
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
}
}