private void BindPageDlls()
        {
            try
            {
                PageController objPageController = new PageController();
                List<PageEntity> LINQParentPages = objPageController.GetActivePortalPages(GetPortalID, GetUsername, "---", true, false, DBNull.Value, DBNull.Value);

                List<PageEntity> objFilterPageLst = FilterPages(LINQParentPages, "sf/");
                List<PageEntity> objstartUpPage = FilterPortalPage(LINQParentPages);

                ddlLoginPage.Items.Clear();
                ddlLoginPage.DataSource = objFilterPageLst;
                ddlLoginPage.DataTextField = "PageName";
                ddlLoginPage.DataValueField = "SEOName";
                ddlLoginPage.DataBind();
                ddlLoginPage.Items.Insert(0, new ListItem("<Not Specified>", "-1"));

                ddlUserRegistrationPage.Items.Clear();
                ddlUserRegistrationPage.DataSource = objFilterPageLst;
                ddlUserRegistrationPage.DataTextField = "PageName";
                ddlUserRegistrationPage.DataValueField = "SEOName";
                ddlUserRegistrationPage.DataBind();
                ddlUserRegistrationPage.Items.Insert(0, new ListItem("<Not Specified>", "-1"));

                //ddlPortalUserActivation
                ddlPortalUserActivation.Items.Clear();
                ddlPortalUserActivation.DataSource = objFilterPageLst;
                ddlPortalUserActivation.DataTextField = "PageName";
                ddlPortalUserActivation.DataValueField = "SEOName";
                ddlPortalUserActivation.DataBind();
                ddlPortalUserActivation.Items.Insert(0, new ListItem("<Not Specified>", "-1"));

                //ddlPortalForgotPassword
                ddlPortalForgotPassword.Items.Clear();
                ddlPortalForgotPassword.DataSource = objFilterPageLst;
                ddlPortalForgotPassword.DataTextField = "PageName";
                ddlPortalForgotPassword.DataValueField = "SEOName";
                ddlPortalForgotPassword.DataBind();
                ddlPortalForgotPassword.Items.Insert(0, new ListItem("<Not Specified>", "-1"));

                //ddlPortalPageNotAccessible
                ddlPortalPageNotAccessible.Items.Clear();
                ddlPortalPageNotAccessible.DataSource = objFilterPageLst;
                ddlPortalPageNotAccessible.DataTextField = "PageName";
                ddlPortalPageNotAccessible.DataValueField = "SEOName";
                ddlPortalPageNotAccessible.DataBind();
                ddlPortalPageNotAccessible.Items.Insert(0, new ListItem("<Not Specified>", "-1"));

                //ddlPortalPageNotFound
                ddlPortalPageNotFound.Items.Clear();
                ddlPortalPageNotFound.DataSource = objFilterPageLst;
                ddlPortalPageNotFound.DataTextField = "PageName";
                ddlPortalPageNotFound.DataValueField = "SEOName";
                ddlPortalPageNotFound.DataBind();
                ddlPortalPageNotFound.Items.Insert(0, new ListItem("<Not Specified>", "-1"));

                //ddlPortalPasswordRecovery
                ddlPortalPasswordRecovery.Items.Clear();
                ddlPortalPasswordRecovery.DataSource = objFilterPageLst;
                ddlPortalPasswordRecovery.DataTextField = "PageName";
                ddlPortalPasswordRecovery.DataValueField = "SEOName";
                ddlPortalPasswordRecovery.DataBind();
                ddlPortalPasswordRecovery.Items.Insert(0, new ListItem("<Not Specified>", "-1"));

                //ddlPortalDefaultPage

                ddlPortalDefaultPage.Items.Clear();
                ddlPortalDefaultPage.DataSource = objstartUpPage;
                ddlPortalDefaultPage.DataTextField = "PageName";
                ddlPortalDefaultPage.DataValueField = "SEOName";
                ddlPortalDefaultPage.DataBind();
                ddlPortalDefaultPage.Items.Insert(0, new ListItem("<Not Specified>", "-1"));


                //ddlPortalUserProfilePage
                ddlPortalUserProfilePage.Items.Clear();
                ddlPortalUserProfilePage.DataSource = objFilterPageLst;
                ddlPortalUserProfilePage.DataTextField = "PageName";
                ddlPortalUserProfilePage.DataValueField = "SEOName";
                ddlPortalUserProfilePage.DataBind();
                ddlPortalUserProfilePage.Items.Insert(0, new ListItem("<Not Specified>", "-1"));
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }
 public void ManageSSLConnection()
 {
     ApplicationController objAppController = new ApplicationController();
     if (!objAppController.CheckRequestExtension(Request))
     {
         if (Session[SessionKeys.Ssl] == null)
         {
             Session[SessionKeys.Ssl] = "True";
             //check logic redirect to or not
             //btn click login and logout prob
             PageController objController = new PageController();
             List<SecurePageInfo> sp = objController.GetSecurePage(currentportalID, GetCurrentCulture());
             string pagename = GetPageSEOName(PagePath);
             if (pagename != "Page-Not-Found")
             {
                 if (Session[SessionKeys.pagename] != null)
                 {
                     prevpage = Session[SessionKeys.pagename].ToString();
                 }
                 if (prevpage != pagename)
                 {
                     Session[SessionKeys.pagename] = pagename;
                     for (int i = 0; i < sp.Count; i++)
                     {
                         if (pagename.ToLower() == sp[i].SecurePageName.ToString().ToLower())
                         {
                             if (bool.Parse(sp[i].IsSecure.ToString()))
                             {
                                 if (!HttpContext.Current.Request.IsSecureConnection)
                                 {
                                     if (!HttpContext.Current.Request.Url.IsLoopback) //Don't check when in development mode (i.e. localhost)
                                     {
                                         Session[SessionKeys.prevurl] = "https";
                                         Response.Redirect(Request.Url.ToString().Replace("http://", "https://"));
                                     }
                                 }
                             }
                             else
                             {
                                 Session[SessionKeys.prevurl] = "http";
                                 Response.Redirect(Request.Url.ToString().Replace("https://", "http://"));
                             }
                         }
                     }
                 }
                 else if (Session[SessionKeys.prevurl] != null)
                 {
                     if (Session[SessionKeys.prevurl].ToString() != Request.Url.ToString().Split(':')[0].ToString())
                     {
                         for (int i = 0; i < sp.Count; i++)
                         {
                             if (pagename.ToLower() == sp[i].SecurePageName.ToString().ToLower())
                             {
                                 if (bool.Parse(sp[i].IsSecure.ToString()))
                                 {
                                     if (!HttpContext.Current.Request.IsSecureConnection)
                                     {
                                         if (!HttpContext.Current.Request.Url.IsLoopback) //Don't check when in development mode (i.e. localhost)
                                         {
                                             Response.Redirect(Request.Url.ToString().Replace("http://", "https://"));
                                         }
                                     }
                                 }
                                 else
                                 {
                                     Response.Redirect(Request.Url.ToString().Replace("https://", "http://"));
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }