protected void Page_Load(object sender, EventArgs e)
    {
        PagesAccess objPagesAccess = new PagesAccess();

        if (objPagesAccess.CheckAccess(Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath), Session[RunningCache.UserProfile].ToString()) == true)
        {
            try
            {
                Stopwatch stopWatch = new Stopwatch();
                stopWatch.Start();

                if (!IsPostBack)
                {
                    if (HttpContext.Current.Session["AlertOn"] != null)
                    {
                        if ((Boolean)HttpContext.Current.Session["AlertOn"] == true)
                        {
                            if (this.global_error.Visible)
                            {
                                this.global_error.Visible = false;
                            }
                            this.global_success.Visible  = true;
                            this.global_success_msg.Text = Mains.Constant.SUCCESS_INSERT;
                        }
                        HttpContext.Current.Session["AlertOn"] = null;
                    }

                    bindgrid();
                    bindSectorInterest();
                    bindAreaInterest();
                    bindUsers();
                }

                if (this.Edit_global.Visible)
                {
                    this.Edit_global.Visible = false;
                }
                bindgrid();
                stopWatch.Stop();
                TimeSpan ts = stopWatch.Elapsed;
                execTimeLit.Text = String.Format("{0:00} minute(s), {1:00} seconde(s), {2:00} milliseconde(s)", ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
            }
            catch (Exception ex)
            {
                if (this.global_success.Visible)
                {
                    this.global_success.Visible = false;
                }
                this.global_error.Visible  = true;
                this.global_error_msg.Text = Mains.Constant.GENERAL_ERR;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PagesAccess objPagesAccess = new PagesAccess();

        if (objPagesAccess.CheckAccess(Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath), Session[RunningCache.UserProfile].ToString()) == true)
        {
            try
            {
                CultureInfo ci = new CultureInfo("en-GB");

                var format = "dd, MMMM  yyyy";

                ClientScript.GetPostBackEventReference(this, string.Empty);

                if (Request.Form["__EVENTTARGET"] == "Disconnect")
                {
                    Disconnect();
                }

                if (Session[RunningCache.UserLogin] == null)
                {
                    Disconnect();
                }

                if (!IsPostBack)
                {
                    if (HttpContext.Current.Session["AlertOn"] != null)
                    {
                        if ((Boolean)HttpContext.Current.Session["AlertOn"] == true)
                        {
                            if (this.global_error.Visible)
                            {
                                this.global_error.Visible = false;
                            }
                            this.global_success.Visible  = true;
                            this.global_success_msg.Text = Mains.Constant.SUCCESS_INSERT;
                        }
                        HttpContext.Current.Session["AlertOn"] = null;
                    }

                    var ss = Session[RunningCache.UserLogin];
                    if (ss != null)
                    {
                        if (!string.IsNullOrEmpty(Session[RunningCache.UserLogin].ToString()))
                        {
                            usr           = Session[RunningCache.UserLogin].ToString();
                            _userFullName = Session[RunningCache.UserFullName].ToString();
                            _userProfile  = Session[RunningCache.ProfileName].ToString();
                            filldata();
                        }
                    }
                    else
                    {
                        Disconnect();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
    }