• 欢迎光临~

ASP.NET中的几种弹出框提示基本实现方法

开发技术 开发技术 2022-12-18 次浏览

原文链接:https://www.jb51.net/article/35046.htm

protected void Page_Load(object sender, EventArgs e)
{
    Button1.Attributes.Add("onclick", "return confirm('确定要删吗?');");
    Response.Write("<Script Language='JavaScript'>window.alert('111');</script>");

    Response.Write("<Script Language='JavaScript'>if ( window.confirm('222')) { window.location.href='222' } else {window.location.href='222' };</script>");

    Response.Write("<script>alert('删除成功!');window.location.href ='www.baidu.com'</script>");

    //ASP.NET 服务器控件在 Page 中发出客户端脚本块:
    Page.RegisterStartupScript("hello", "<script>alert('你好!')</script>");
}

 

程序员灯塔
转载请注明原文链接:ASP.NET中的几种弹出框提示基本实现方法
喜欢 (0)