I have small page, it looks follows:
Some header
Label with text only for logged users
Hyperlink
Logout button
Here is the behind code:
protected void Page_Load(object sender, EventArgs e)
{
if (User.Identity.Name == "")
{
Label1.Visible = false;
Controls.Remove(Label1);
}
else
{
Label1.Visible = true;
}
}
Question is: When non logged user loads page, the label is not shown. But how to move the hyperlink and logOutButton and thus hide the white space on place, where the label is invisible ?
Thanks
You have to use the css display:none here