Beispiel #1
0
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);

            ClientSideScript = MessageBoxText != string.Empty ? string.Format("messageBox('{0}','{1}','alert','{2}');", MessageBoxText, messageBoxTitle, messageBoxType) : string.Empty;
            ClientSideScript = closeModalResultValue != string.Empty ? string.Format("closeModal('{0}');", closeModalResultValue) : string.Empty;

            if (IsModal && !IsPostBack)
            {
                ClientSideScript = "parent.modalLoadCompleted(window);";
            }

            ClientSideScript = "if(parent.loadPageComplete) parent.loadPageComplete();";

            CryptorEngine encryptor = new CryptorEngine();

            if (Page.Request.Url.OriginalString.Contains("PageLoaderLight"))
            {
                ClientSideScript = string.Format("authenticationString = '{0}';validationString = '{1}';", encryptor.Encrypt(Helper.GetUrlWithoutPortNumber(Page.Request.UrlReferrer.OriginalString)), Helper.Encrypt(encryptor.GetObjectData() + "$" + Helper.GetUrlWithoutPortNumber(Page.Request.UrlReferrer.OriginalString), Session));
            }
            else
            {
                ClientSideScript = string.Format("authenticationString = '{0}';validationString = '{1}';", encryptor.Encrypt(Helper.GetUrlWithoutPortNumber(Page.Request.Url.OriginalString)), Helper.Encrypt(encryptor.GetObjectData() + "$" + Helper.GetUrlWithoutPortNumber(Page.Request.Url.OriginalString), Session));
            }

            if (ClientSideScript != string.Empty)
            {
                writer.WriteLine("<script type=\"text/javascript\">var authenticationString;var validationString;$(document).ready(function(){" + ClientSideScript + "});</script>");
            }
        }