protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Lbl_Error.Visible = false;
         if (Request.QueryString["FL"] != null)
         {
             if (Session["UGRP"] != null)
             {
                 OC = "0";
                 int RC = LG.UpdateLoginsts(Session["UID"].ToString(), encrypt(Session["PWD"].ToString()), OC, Session["BRCD"].ToString());
                 Logout();
             }
         }
         if (Request.QueryString["UG"] != "1" && Request.QueryString["BD"] != null && Request.QueryString["LG"] != "1")
         {
             int TTT = ForceLogout(Request.QueryString["BD"].ToString(), Request.QueryString["UG"].ToString(), Request.QueryString["LG"].ToString());
             if (TTT > 0)
             {
                 WebMsgBox.Show("User " + Request.QueryString["LG"].ToString() + " is Logged out due to Inactivity...!", this.Page);
                 return;
             }
         }
         PropertyInfo isreadonly = typeof(System.Collections.Specialized.NameValueCollection).GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);
         // make collection editable
         isreadonly.SetValue(this.Request.QueryString, false, null);
         // remove
         this.Request.QueryString.Remove("FL");
     }
 }
    public void PageLoad()
    {
        try
        {
            hdnSession.Value     = Session["SessionTimeout"].ToString();
            lblUserName.Text     = string.IsNullOrEmpty(Session["UserName"].ToString()) == true ? "0" : Session["UserName"].ToString();
            TxtWorkigDate.Text   = LG.openDay(Session["BRCD"].ToString());
            Session["EntryDate"] = LG.openDay(Session["BRCD"].ToString());

            DT = LG.GetBankNameATTACH(Session["BRCD"].ToString());
            if (DT.Rows.Count > 0)
            {
                string   BB  = DT.Rows[0]["BankName"].ToString();
                string[] BRB = BB.Split('_');
                lblbankName.Text    = BRB[0].ToString() + " - " + BRB[1].ToString();
                Session["BName"]    = BRB[1].ToString();
                Session["BankName"] = BRB[0].ToString(); //Amruta 09/05/2018
            }

            if (Session.Contents.Count == 0)
            {
                LG.UpdateLoginsts(Session["UID"].ToString(), Session["PWD"].ToString(), "0", Session["BRCD"].ToString());
            }
            this.BindMenu();

            Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout)) + ";URL=FrmLogin.aspx?LG=" + Session["LOGINCODE"] + "&BD=" + Session["BRCD"].ToString() + "&UG=" + Session["UGRP"].ToString());
            Session["BNKCDE"] = CB.GetBnkCde(Session["BName"].ToString());
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }