ASP.NET有没有类似javascript中的window.confirm( )这样的方法,弹出对话框提示是否确认?
有一个取消按钮,点击后我想弹出一个对话框提示将要取消,是否确认,确认的话
则接着运行。
我写了这么一段代码:
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("<script language=javascript>");
Response.Write("if(confirm(\"Are you sure you want to start over?\"))");
Response.Write("{");
Response.Write("self.location.href=\"WebForm2.aspx\""); <- 这里
Response.Write("}");
Response.Write("</script>");
}
指出的地方用的也是javascript的函数,如果调用C#写的函数应该怎么做呀?
如果ASP.NET中有替代的功能就最好了。
请大家帮帮忙,谢谢!