using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class Default2 : System.Web.UI.Page
{
    
protected void Page_Load(object sender, EventArgs e)
    {
      
    }
    
protected void Button1_Click(object sender, EventArgs e)
    {
        PopUpManager(
"弹出的对话框""http://www.baidu.com");
    }
    
/// <summary>
    
/// Javascript弹出对话框并跳转页面
    
/// </summary>
    
/// <param name="_Msg">要弹出对画框中的内容</param>
    
/// <param name="URL">要跳转的URL</param>
    public void PopUpManager(string body, string URL)
    {
        
string Script;
        Script 
= ("<script language=javascript>");
        Script 
+= "var retValue=window.confirm('" + body + "');" + "if(retValue){window.location='" + URL + "';}";
        Script 
+= ("</script>");
        System.Web.HttpContext.Current.Response.Write(Script);
    }
}

相关文章:

  • 2022-12-23
  • 2022-02-09
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
  • 2021-10-29
猜你喜欢
  • 2022-03-08
  • 2021-06-02
  • 2021-11-11
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案