• asp.net服务器向客户端弹出对话框,但不使页面边白板


       1:  using System;
       2:  using System.Collections.Generic;
       3:  using System.Linq;
       4:  using System.Web;
       5:  using System.Web.UI;
       6:  using System.Web.UI.WebControls;
       7:   
       8:  public partial class ClientScript : System.Web.UI.Page
       9:  {
      10:      protected void Page_Load(object sender, EventArgs e)
      11:      {
      12:          Response.Write("<script>alert('test1---直接Response输出')</script>");
      13:   
      14:          Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('test2')</script>");
      15:   
      16:          if (!ClientScript.IsClientScriptBlockRegistered(this.GetType(), "ClientScriptBlock"));  
      17:          {
      18:              ClientScript.RegisterClientScriptBlock(this.GetType(), "ClientScriptBlock", "<script>alert('test3---靠近<form>先弹出')</script>");
      19:          }
      20:   
      21:          if (!ClientScript.IsStartupScriptRegistered(this.GetType(), "StartupScript"))
      22:          {
      23:              ClientScript.RegisterStartupScript(this.GetType(), "StartupScript", "<script>alert('test4---靠近</form>后弹出')</script>");
      24:          }
      25:   
      26:      }
      27:  }

    可以通过查看页面源码,看看有什么不同…

  • 相关阅读:
    配置FTP服务
    Tomcat
    LNMP环境配置(下)
    LNMP环境配置(上)
    Ansible---
    Ansible
    正则三剑客-------grep
    Docker仓库的使用与维护
    Docker 引擎的安装 -->>存储库安装
    shell脚本实例
  • 原文地址:https://www.cnblogs.com/KingsWang/p/3393319.html
Copyright © 2020-2023  润新知