コード例 #1
0
        private void InitScripts()
        {
            AddCommon(LoadControl(VirtualPathUtility.ToAbsolute("~/Masters/CommonStyles.ascx")), HeadStyles);
            AddCommon(LoadControl(VirtualPathUtility.ToAbsolute("~/Masters/CommonBodyScripts.ascx")), BodyScripts);
            AddStyles("~/skins/<theme_folder>/main.less", true);

            AddClientScript(typeof(MasterResources.MasterSettingsResources));
            AddClientScript(typeof(MasterResources.MasterUserResources));
            AddClientScript(typeof(MasterResources.MasterFileUtilityResources));
            AddClientScript(typeof(MasterResources.MasterCustomResources));

            if (ClientLocalizationScript != null)
            {
                AddClientLocalizationScript(typeof(MasterResources.MasterLocalizationResources));
                AddClientLocalizationScript(typeof(MasterResources.MasterTemplateResources));

                if (clientScriptReference == null)
                {
                    clientScriptReference = new ClientScriptReference();
                }
                if (0 < clientScriptReference.Includes.Count)
                {
                    ClientLocalizationScript.Scripts.Add(clientScriptReference.GetLink(true));
                }
            }
        }
コード例 #2
0
        private void InitScripts()
        {
            AddStyles("~/skins/<theme_folder>/main.less", true);

            AddClientScript(typeof(MasterResources.MasterSettingsResources));
            AddClientScript(typeof(MasterResources.MasterUserResources));
            AddClientScript(typeof(MasterResources.MasterFileUtilityResources));
            AddClientScript(typeof(MasterResources.MasterCustomResources));

            InitProductSettingsInlineScript();
            InitStudioSettingsInlineScript();

            if (ClientLocalizationScript != null)
            {
                AddClientLocalizationScript(typeof(MasterResources.MasterLocalizationResources));
                AddClientLocalizationScript(typeof(MasterResources.MasterTemplateResources));

                if (clientScriptReference == null)
                {
                    clientScriptReference = new ClientScriptReference();
                }
                if (0 < clientScriptReference.Includes.Count)
                {
                    ClientLocalizationScript.Scripts.Add(clientScriptReference.GetLink(true));
                }
            }
        }
コード例 #3
0
        public void AddClientLocalizationScript(Type type)
        {
            if (clientScriptReference == null)
            {
                clientScriptReference = new ClientScriptReference();
            }

            clientScriptReference.Includes.Add(type);
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SecurityContext.IsAuthenticated && User.ID != SecurityContext.CurrentAccount.ID)
            {
                Response.Redirect(GetRefererURL());
                return;
            }

            if (!CoreContext.Configuration.YourDocs)
            {
                _communitations.Controls.Add(LoadControl(AuthCommunications.Location));
            }

            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/Management/SmsControls/js/confirmmobile.js"));
            Page.RegisterStyleControl(VirtualPathUtility.ToAbsolute("~/usercontrols/management/SmsControls/css/confirmmobile.less"));

            Context.Session["SmsAuthData"] = User.ID;

            if (string.IsNullOrEmpty(User.MobilePhone))
            {
                Activation = true;
            }

            if (!Activation)
            {
                try
                {
                    SmsManager.PutAuthCode(User, false);
                }
                catch (Exception)
                {
                    Activation = true;
                }
            }

            if (Activation)
            {
                var ipGeolocationInfo = new GeolocationHelper("db").GetIPGeolocationFromHttpContext();
                if (ipGeolocationInfo != null)
                {
                    Country = ipGeolocationInfo.Key;
                }

                var clientScriptReference = new ClientScriptReference();
                clientScriptReference.Includes.Add(typeof(CountriesResources));
                Page.RegisterBodyScripts(clientScriptReference);

                Page.RegisterBodyScripts(ResolveUrl("~/js/asc/plugins/countries.js"));
                Page.RegisterBodyScripts(ResolveUrl("~/js/asc/plugins/phonecontroller.js"));
                Page.RegisterStyleControl(VirtualPathUtility.ToAbsolute("~/skins/default/phonecontroller.css"));
            }
        }