using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControls_WebUserControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        litOnLineUserCount.Text =
            string.Format("OnLineUserCount:{0:#,##0}", Application["OnLineUserCount"]);
        litSessionId.Text =
            string.Format("SessionId :{0}", Session.SessionID);

        if (Session["UserId"] != null)
        {
            lnkLogin.Visible = false;
            lnkLogout.Visible = true;
            lblWelcome.Visible = true;
            lnkRegister.Visible = false;
            litProfile.Visible = true;
            lnkProfile.Visible = true;
            litDeleteUser.Visible = true;
            lnkDeleteUser.Visible = true;

            string strUsername =
                Session["Username"].ToString();

            lblWelcome.Text = string.Format("| Welcome {0}!", strUsername);
        }

        else
        {
            lnkLogin.Visible = true ;
            lnkLogout.Visible = false;
            lblWelcome.Visible = false;
            lnkRegister.Visible = true;
            litProfile.Visible = false;
            lnkProfile.Visible = false;
            litDeleteUser.Visible = false;
            lnkDeleteUser.Visible = false;

            lblWelcome.Text = string.Empty;
               
        }
    }
}