• 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:  }

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

  • 相关阅读:
    EntityFramework+MySql 笔记2
    EntityFramework+MySql 笔记1
    软件详细设计文档(终)
    软件测试文档(终)
    软件测试计划文档(初)
    软件概要设计文档(终)
    软件需求规格说明文档(终)
    例会记录(六)
    例会记录(五)
    例会记录(四)
  • 原文地址:https://www.cnblogs.com/KingsWang/p/3393319.html
Copyright © 2020-2023  润新知