asp.net 后台调用confirm
using System;
using System.Web.UI;
public partial class _Default : System.Web.UI.Page, IPostBackEventHandler
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
ScriptManager.RegisterStartupScript(this, this.GetType(), "confirm",
"if(confirm('你确定1+1=2吗?'))" + this.ClientScript.GetPostBackEventReference(this, "确定") + "; else " +
this.ClientScript.GetPostBackEventReference(this, "不确定"), true);
}
public void RaisePostBackEvent(string eventArgument)
{
string res;
switch (eventArgument)
{
case "确定":
res = "太有才了!"; //处理各种后台任务
break;
case "不确定":
res = "是块当实习生的料。"; //处理各种后台任务
break;
default:
throw new NotSupportedException();
}
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('" + res + "');", true);
}
}
asp.net 后台调用confirm的更多相关文章
- Asp.net 后台调用js方法(转)
1. 用Response.Write方法 代码如下: Response.Write("<script type='text/javascript'>alert("XXX ...
- 通用SQL存储过程分页以及asp.net后台调用
创建表格并添加300万数据 use Stored CREATE TABLE UserInfo( --创建表 id ,) PRIMARY KEY not null,--添加主键和标识列 UserName ...
- asp.net后台调用前台js代码
为了通过ajax异步获取数据,我通过使用jquery的$(function{})方法,在页面加载时发送ajax请求,获取相关的数据.但是遇到了一个问题,当我发送的ajax请求需要根据传过来的URL参数 ...
- ASP.NET后台调用前台JS函数的三种常见方法
第一种:使用普通的添加控件中的Attributes属性进行调用 例如,像一般的普通的按钮:Button1.Attributes.Add("onclick","MyFun( ...
- ASP.NET后台调用API方法
/// <summary> /// 调用API POST请求与获取结果 /// </summary> ///URL 与 JSON串 public static string H ...
- Asp.net 后台调用js方法
购物车实现逻辑简单.代码量也很少,具体细节就不说了,使用的时候,只要把MockDB类稍微改改,因为它是商品数据入口,为实现分布式部署,实际应用时可以更改为从服务调用,如:Web Service.WCF ...
- asp.net后台对前台脚本的调用
后台像前台输出要执行的脚本 Response.Write("<script>alert('内容')</script>"); asp.net后台调用前台js脚 ...
- ASP.NET 前台Javascript调用后台代码 / 后台调用前台Javascript
1:ASP.NET 前台Javascript调用后台代码 1.1:前台Javascript <script> function CallCs() { var str = "< ...
- Asp.Net前台调用后台变量
1.Asp.Net中几种相似的标记符号: < %=...%>< %#... %>< % %>< %@ %>解释及用法 答: < %#... %&g ...
随机推荐
- xampp下载地址 一个集成的易于安装的WEB环境部署包
XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包.这个软件包原来的名字是 LAMPP,但是为了避免误解,最新的几个版本就改名为 XAMPP 了.它可以在Windo ...
- (回溯法)数组中和为S的N个数
Given a list of numbers, find the number of tuples of size N that add to S. for example in the list ...
- 网络地址转换相关函数使用(inet_addr,inet_ntoa,inet_addr)
aa 相关函数原型及参数类型: 函数原型:int inet_aton(const char *cp, struct in_addr *inp); in_addr_t inet_addr(const c ...
- bundle中vim相关快捷键的使用
http://www.cnblogs.com/respawn/archive/2012/08/21/2649483.html http://blog.163.com/liao_ya/blog/stat ...
- android中listview点击事件失效的灵异事件
首先说明一下我想实现的功能: 点击某个item之后,让其颜色发生变化.如果变化网上有很多例子,我就不班门弄斧了.Listview之所以点击没有反应是因为上图中绿色部分(自己定义的一个继承BaseAda ...
- android源代码在线阅读
http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/
- MESI-CPU缓存一致性协议
转http://blog.csdn.net/realxie/article/details/7317630 http://en.wikipedia.org/wiki/MESI_protocol MES ...
- Negative seek offset的解决方法
ZIP文件解压的时候出现错误:Negative seek offset 原因是把rar文件直接改为ZIP. 必须要 重新压缩为ZIP文件 不能直接修改文件名.
- OpenERP对象字段定义的详解
OpenERP对象支持的字段类型有,基础类型:char, text, boolean, integer, float, date, time, datetime, binary:复杂类型:select ...
- js 不固定传参
js 不固定传参 CreationTime--2018年7月2日15点18分 Author:Marydon /** * 声明一个函数 * @explain 传参个数不确定 */ function ...