当前位置:编程学习 > C#/ASP.NET >>

C#怎样用javascript 弹出 confirm对话框

怎样在asp.net(C#)中用 JAVASCRIPT弹出confirm对话框?
如果点击“确定”就执行下列语句,“取消”就退出。。。 --------------------编程问答-------------------- if(confirm("你点布点")){
alert("你点了")
} --------------------编程问答-------------------- 方法很多

if(!this.Page.IsPostBack)
{
  this.button1.Attributes.add("onclick","return foo()");
}
自己在前端,写一个javascript的foo函数,里面写 return confirm(xxxx);
--------------------编程问答--------------------      if (confirm(meg)) {
            alert("ok");
        } else {
            this.close();
        } --------------------编程问答-------------------- Response.Write("<script>javascript代码</script>"); --------------------编程问答-------------------- 语句如下,想在if 那里加入类似confirm()语句该如何加阿。

provide void menu1_menuitemclick(object sender, menueventargs e)

switch (e.item.value)
{
case "0"
 If 对话框点确定
  {
语句一
}
else
{
break;
}

}


--------------------编程问答-------------------- C# code?

if(!this.Page.IsPostBack) {   this.button1.Attributes.add("onclick","return foo()"); } 自己在前端,写一个javascript的foo函数,里面写 return confirm(xxxx);


+1 --------------------编程问答-------------------- cs:
mycontrol.Attributes.Add("onclick", "confirm();");
js:
<input tyle="hidden" Id="hidValue"
function confirm()}{
var result = window.confirm("确定删除吗");
        if(result){
            window.location = "default.aspx?action=yes";//参数的方法
            hidValue="yes";//隐藏控件的方法
        }else{
            window.location = "default.aspx?action=no";
             hidValue="no";
        }
} --------------------编程问答-------------------- response.write("<script>alert('文字。。。');中间这里放javascript程序;</script>"); --------------------编程问答-------------------- 看到大多实例都是设置button的onclick属性。但我现在使用menu菜单,该如何设置menu中选择的菜单,使之触发confirm()?谢谢
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,