就ok执行不同的codeS和证实消息的取消 [英] Execute different codes on ok and cancel of confirm message
本文介绍了就ok执行不同的codeS和证实消息的取消的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文本框,我想创建text_changed事件的确认消息并确定执行不同的codeS和下text_changed事件code取消后面
< ASP:文本框ID =TextBox1的=服务器ontextchanged =TextBox1_TextChanged>< / ASP:文本框>
解决方案
试试你的 TextBox1_TextChanged
块这里面code:
ClientScript.RegisterStartupScript(Page.GetType(),验证,<脚本>'?preSS OK继续如果(window.confirm()){ //就ok点击}< / SCRIPT>中);
I have a textBox and I want to create a confirm message on text_changed event and execute different codes on ok and cancel in code behind under text_changed event
<asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged"></asp:TextBox>
解决方案
try this code inside your TextBox1_TextChanged
block:
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script>if(window.confirm('Press ok to continue?')){// on ok clicked }</script>");
这篇关于就ok执行不同的codeS和证实消息的取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文