Response.Write("<form id=\"form\" action=\"" + cmbchina + "\" method=\"post\" name=\"payform\">");
                    Response.Write("<input name=\"branchid\" value=\"" + branchid + "\" type=\"hidden\">");
                    Response.Write("<input name=\"cono\" value=\"" + cono + "\" type=\"hidden\">");
                    Response.Write("<input name=\"billno\" value=\"" + billno + "\" type=\"hidden\">");
                    Response.Write("<input name=\"amount\" value=\"" + num + "\" type=\"hidden\">");
                    Response.Write("<input name=\"date\" value=\"" + date + "\" type=\"hidden\">");
                    Response.Write("<input name=\"merchanturl\" value=\"" + merchanturl + "\" type=\"hidden\">");
                    Response.Write("<input name=\"merchantpara\" value=\"" + merchantpara + "\" type=\"hidden\">");                    CMBCHINALib.FirmClientClass aa = new FirmClientClass();
                    String strVerifyCode = aa.exGenMerchantCode("zzzz", date, branchid, cono, billno, 
                        num.ToString(), merchantpara, merchanturl, "xxx", "xxx", "xxxx",
                        "tttt", "<CardBank>" + BankBox.Value + "</CardBank>").ToString();
                    Response.Write("<input name=\"MerchantCode\" value=\"" + strVerifyCode + "\" type=\"hidden\">");                    Response.Write("</form>");
                    Response.Write("<script>document.payform.submit();</script>");
        
                    //Page.RegisterStartupScript("a", "ShowDialog();");
                    //Page.RegisterStartupScript("xxx", "<script>ShowDialog();</script>");
                    Page.ClientScript.RegisterStartupScript(typeof(string), "xxxx", "<script>ShowDialog();</script>");我想要在payform.submit()后,原来页面上的脚本执行,显示一个层,但现在ShowDialog()不能执行。如果把最后一行代码放在Response.Write前面并在后面加上Return,就执行呢。

解决方案 »

  1.   

    先要注册ShowDialog脚本,然后再使用,不知道你是不是在注册之前就使用了
      

  2.   

    document.payform.submit(); 提交?
    不是很明白你要做什么?
    Response.Write("<script>document.payform.submit();</script>"); 是指某个form提交出去?
    这时候整个form的句柄就不是原来的句柄了。
      

  3.   

    bdmh:
    ShowDialog()这个还要怎么提前注册呢?
      

  4.   

    Response.Write("<script>document.payform.submit();</script>");不是在注册脚本之前吗,不太清楚你的操作流程啥样
      

  5.   

    这个页面实现的功能是和支付宝等网上银行支付一样,选择银行后后,直接用Response.Write("<script>document.payform.submit();</script>");提交一个新的Form,原来的页面上想显示一个浮动的层,用来等待用户的反馈,现在是充值提交的页面正常了,另外的那个层不能执行。
      

  6.   

    这样搞这么多Response.Write完全是ASP里的搞法,维护也不方便
    简单点可以把它们挪到aspx中用个PlaceHolder之类的包起来,然后cs中控制它的Visible属性就行了