When Real User Login Loout Link Appears

Jayakumars
Posted by Jayakumars under ASP.NET AJAX category on | Points: 40 | Views : 587
When Real User Login Loout Link Appears
==================================

protected void Button2_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt=dtBind("Select count(*) from [Table_1] where username='"+ Txtusername.Text +"' and password='"+ TxtPassword.Text +"'");
if (Convert.ToInt32(dt.DefaultView[0][0]) > 0)
{
lnk1.Visible = true;
lnk1.Text = "Logout";
}
else
{
lnk1.Visible = true;
lnk1.Text = "Invalid Login Details";
}
}
protected void lnk1_Click(object sender, EventArgs e)
{
Session.Abandon();
lnk1.Text = "Login";
}

public DataTable dtBind(string Sqry)
{
DataTable dty = new DataTable();
sqlcon.Open();
da = new SqlDataAdapter(Sqry, sqlcon);
da.Fill(dty);
return dty;
}

Comments or Responses

Login to post response