protected void Page_Load(object sender, EventArgs e) { b1.Attributes.Add("onclick", "javascript:if(confirm('确定要删除吗?')){}else{return false;}"); } 简单方便,屡试不爽
在类中写一个函数 public void WebMessageBox(string values) { HttpContext.Current.Response.Write("alert('" + values + "');history.back()"); HttpContext.Current.Response.End(); } public void WebMessageBox(string values,string Page...
Response.Write("alert('您还没有登录,请先登录');window.location = 'login.aspx';");
这样写就可以了, Response.Write("if(confirm('你真的要删除这条数据吗?')){return true;}else{return false}"); 重要的是返回值,当返回true时,将提交到服务器,当返回false时,就终止了向服务器的提交动作;
用js就行了 if (!confirm("确认要删除?")) { window.event.returnValue = false; }为true的时候是确认,false的时候是取消
.black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .white_content { display: non...
除非 自己写一个div 仿对话框 才能显示出 "继续" 和 "登入" 要么用js
这很简单哈,第一种,在该按钮中加入一个,client click()事件,用JavaScript编写哈!其次就是,利用response.write();将JavaScript代码嵌入进去;第三,你再网上搜 return confirm()这个东西,我现在没有时间,不细说了哈
Response.Write输出完之后后面的代码肯定是会执行的,你这个前台要用ajax调后台方法,类似于调Webservice的方法;或者用通过直接调用
Response.Write("alert('删除失败!');"); 这样不行吗,可以的,如果不懂在HI我吧