• asp.net js 提示信息封装函数


         /// <summary>
            /// js 提示信息 例子如 只提示信息 可以JavaScript("hell world!")
            /// 如果有其他脚本可以JavaScript("alert('hello world!');","document.location='default.aspx';")
            /// </summary>
            /// <param name="actions"></param>
            public void JavaScript(params string[] actions)
            {
                string action = "";
                if (actions.Length > 1)
                {
                    action = string.Format("{0}",  string.Join("",actions));
                }
                else
                {
                    action = string.Format("alert('{0}')", string.Join("", actions));
                }
                ScriptManager.RegisterClientScriptBlock(this, typeof(string), "key" + new Random().Next(1000), string.Format("<script defer=\"defer\">{0}</script>", action), false);
               
            }
  • 相关阅读:
    纯JavaScripst的全选、全不选、反选 【转】
    Java 文件和byte数组转换
    nc命令使用详解
    mtr 命令详解
    Nginx主动检测方案---Tengine
    Apache相关安全设置
    tomcat APR的配置
    Vsftpd 配置详解
    FTP主动模式和被动模式的区别
    iptables配置详解
  • 原文地址:https://www.cnblogs.com/wanyuan8/p/2469290.html
Copyright © 2020-2023  润新知