My idea is when the user logs in the "login" and "register" will no longer be seen and instead it will show the user name first name on the navbar.
Markup:
<ul class="nav navbar-nav">
<li>
<a href="#">Register<span class="glyphicon glyphicon-user"</span></a>
</li>
<li id="LoginBTN">
<a href="#">Log in<span class="glyphicon glyphicon-log-in"></span></a>
</li>
</ul>
Code behind:
protected void BTNLogIn_Click(object sender, ImageClickEventArgs e)
{
SqlMyName SqlUser= new SqlMyName ();
DataSet DsUser = new DataSet();
string StUser = "SELECT TblUsers.User_Name, TblUsers.Pass FROM TblUsers WHERE (((TblUsers.User_Name)= '" + TXTUserName.Text + "') AND ((TblUsers.Pass)= '" + TXTPass.Text + "'));";
DsUser = SqlUser.chkData(StUser);
if (DsUser.Tables[0].Rows.Count > 0)
{
string StShowFname = "SELECT TblUsers.Fname FROM TblUsers WHERE (((TblUsers.User_Name)= '" + TXTUserName.Text + "'));";
DataSet DsShowFname = SqlUser.chkData(StShowFname);
//How can I unshow or change text of <li>?
}
}
What should I do in the code behind?