protected void CheckLogin()
{
Panel postPanel = (Panel)ContentPlaceHolder1.FindControl("PostPanel");
if (Session["UserName"] == null)
{
MessageLabel.Text = "";
LoginPanel.Visible = true;
if (postPanel != null)
{
postPanel.Visible = false;
}
LogoutButton.Visible = false;
}
else
{
LoginPanel.Visible = false;
LogoutButton.Visible = true;
MessageLabel.Text = "Welcome, " + Session["UserName"];
if (postPanel != null)
{
postPanel.Visible = true;
}
}
}