zoukankan      html  css  js  c++  java
  • ajax下的javascript

    例1、

    如果你用的是微软的ajax框架,弹出提示框应该用:
    ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('对不起,账号和密码错误');", true);

    例2、

    protected void LinkButton_DocName_Command(object sender, CommandEventArgs e)//查看文献详情
    {
    string docID = e.CommandArgument.ToString();
    string key = "js";
    string javascript = " <script>window.open('DocumentDetail.aspx?docID=" + docID + "','_blank','height=300, width=820,toolbar=no,scrollbars=yes, resizable=yes') </script>";
    ScriptManager.RegisterStartupScript(GridView1, GridView1.GetType(), key, javascript, false);
    }

    P.S.

    public static void OpenerReload(Page page, string key)

            {

                Type cstype = page.GetType();

                ClientScriptManager cs = page.ClientScript;

                if (!cs.IsStartupScriptRegistered(cstype, key))

                {

                    String cstext = "window.opener.window.document.forms(0).submit();window.opener.location.href=window.opener.location.href;";//window.opener.location.reload();";

                    cs.RegisterStartupScript(cstype, key, cstext, true);

                }

            }

    //我恨ajax!

  • 相关阅读:
    vs2010 项目生成成功,发布失败
    net导出到excel数字变为科学技术法
    vba 2-6位随机大小写字母
    vba 延时
    foxmail错误信息:501 请登录exmail.qq.com修改密码
    电脑开机出现C:WindowsSystem32driversfs_rec.sys
    向txt中插入一行数据
    定时关机
    ASCII码
    C# 事件与继承
  • 原文地址:https://www.cnblogs.com/pokay/p/1486554.html
Copyright © 2011-2022 走看看