RT:
protected void Button1_Click(object sender, EventArgs e)
{
if(this.TextBox1.Text == "0")
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "confirm", "if(window.confirm('" + "讀者張三 應繳逾期罰款 10 元,是否已經完成繳費?')){window.document.getElementById('" + Button2.ClientID + "').focus();window.document.getElementById('" + Button2.ClientID + "').click();}else{window.document.getElementById('" + Button3.ClientID + "').focus();window.document.getElementById('" + Button3.ClientID + "').click();}", true);
return;
}
this.Label1.Text = "bbb";
} protected void Button2_Click(object sender, EventArgs e)
{
this.Label1.Text = "已繳";
} protected void Button3_Click(object sender, EventArgs e)
{
this.Label1.Text = "未繳";
}
点击确认或取消 Button2和Button3服务器事件不执行
protected void Button1_Click(object sender, EventArgs e)
{
if(this.TextBox1.Text == "0")
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "confirm", "if(window.confirm('" + "讀者張三 應繳逾期罰款 10 元,是否已經完成繳費?')){window.document.getElementById('" + Button2.ClientID + "').focus();window.document.getElementById('" + Button2.ClientID + "').click();}else{window.document.getElementById('" + Button3.ClientID + "').focus();window.document.getElementById('" + Button3.ClientID + "').click();}", true);
return;
}
this.Label1.Text = "bbb";
} protected void Button2_Click(object sender, EventArgs e)
{
this.Label1.Text = "已繳";
} protected void Button3_Click(object sender, EventArgs e)
{
this.Label1.Text = "未繳";
}
点击确认或取消 Button2和Button3服务器事件不执行
解决方案 »
- 下载文件 保存后 页面刷新的问题
- C#调用c++Dll指针数组
- FileUpload在上传大文件时临时文件保存到了哪里?
- 若有四个textbox的值,首先判断其中两个值是否存在数据库里,若是,update set,若不是,创建insert into
- 请大家推荐一个开源问卷调查系统
- 求asp.net 1.1 验证控件 在 firefox 下解决方式
- 置疑net1.1的帮助文档的DataGrid.DataSource
- 虚拟空间数据库路径问题
- 初学者问题:同样的代码用asp或html正常,改成aspx就报错,为什么
- 博客的开发
- 用过autocompleteextender这个控件的进来
- js 知道控件的tabindex 怎么根据这个得到该控件的id
主要是想弄明白在updatepanel里弹出确认取消执行相应的服务器事件
if(this.TextBox1.Text == "0")
并不是次次都弹出来
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ConfirmButton/ConfirmButton.aspx使用楼主的方法确实不能更新画面,已验证js执行了,并且Button2_Click、Button3_Click可以执行,但是画面不更新
怀疑ajax机制与confirm冲突