Пример #1
0
        public static void Message(System.Web.UI.Page page, string message, string newURL)
        {
            System.Web.UI.ClientScriptManager manager = page.ClientScript;
            if (manager.IsStartupScriptRegistered("MESSAGE"))
            {
                return;
            }
            string script = string.Format("alert(\"{0}\"); location.href = \"{1}\";", message, newURL);

            manager.RegisterStartupScript(page.GetType(), "MESSAGE", "\t" + script + "\n", true);
        }
Пример #2
0
        /// <summary>
        /// aspx页面注册JAVASCRIPT
        /// </summary>
        /// <param name="str"></param>
        /// <param name="cstype"></param>
        private void RegJs(string str, Type cstype, System.Web.UI.Page page)
        {
            String s = "<script>";

            s += "alert('" + str.Trim() + "');" + "<" + "/" + "script>";
            //Type cstype = this.GetType();
            String csname1 = "PopupScript";

            System.Web.UI.ClientScriptManager cs = page.ClientScript;
            if (!cs.IsStartupScriptRegistered(cstype, csname1))
            {
                cs.RegisterStartupScript(cstype, csname1, s, false);
            }
        }
Пример #3
0
        public static void Message(System.Web.UI.Page page, string message, bool reload)
        {
            if (!reload)
            {
                Message(page, message);
                return;
            }

            System.Web.UI.ClientScriptManager manager = page.ClientScript;
            if (manager.IsStartupScriptRegistered("MESSAGE"))
            {
                return;
            }
            string script = string.Format("alert(\"{0}\"); location.replace(location.href)", message);

            manager.RegisterStartupScript(page.GetType(), "MESSAGE", "\t" + script + "\n", true);
        }
Пример #4
0
        public static void jquerymodalmessage(System.Web.UI.Page mypage, string s)
        {
            String csname1 = "PopupScript";
            Type   cstype  = mypage.GetType();

            System.Web.UI.ClientScriptManager cs = mypage.ClientScript;
            if (!cs.IsStartupScriptRegistered(cstype, csname1))
            {
                System.Text.StringBuilder mytext = new System.Text.StringBuilder();
                mytext.Append("<script type=text/javascript>");
                mytext.Append("$('#modaltable').show();");
                mytext.Append("jQuery('#maintable').css('opacity', '0.6'); ");
                mytext.Append("jQuery('#modalid').html(\"" + (s == "" ? "" : HttpUtility.JavaScriptStringEncode(s)) + "\")");
                mytext.Append("</");
                mytext.Append("script>");
                cs.RegisterStartupScript(cstype, csname1, mytext.ToString());
            }
        }
Пример #5
0
 /// <summary>
 /// Gets a Url for the configuration of the tax provider implementation
 /// </summary>
 /// <param name="cs">ClientScriptManager</param>
 /// <returns>A Url for the configuration of the tax provider implementation</returns>
 public virtual string GetConfigUrl(System.Web.UI.ClientScriptManager cs)
 //Should have been abstract. But because it is added later
 //we need to have a default implementation so that existing providers do not break;
 {
     return(string.Empty);
 }
Пример #6
0
 /// <summary>
 /// The configuration URL where the provider can be configured
 /// </summary>
 /// <param name="cs">ClientScriptManager</param>
 /// <returns>The configuration URL where the provider can be configured</returns>
 public abstract string GetConfigUrl(System.Web.UI.ClientScriptManager cs);
 /// <summary>
 /// The configuration URL where the provider can be configured
 /// </summary>
 /// <param name="cs">ClientScriptManager</param>
 /// <returns>The configuration URL where the provider can be configured</returns>
 public override string GetConfigUrl(System.Web.UI.ClientScriptManager cs)
 {
     return("DefaultProvider/AddKeys.aspx");
 }