从代码隐藏页面显示确认框,并输入是或否以供进一步使用. [英] Display A Confirm Box from a CodeBehind Page and Take Input Yes or No for further use.
问题描述
大家好,
有人可以建议我如何在后面的代码中写入确认框吗?无论用户单击确定"还是"
",我都想获得返回值'cancel',
这取决于我需要使用if else
Hi all,
Can anyone suggest me how to write the confirm box in code behind
and i want to get the return value whether the user clicked ''ok'' or
''cancel'',
Depending on that i need to process further using if else
推荐答案
有人可以建议我如何在后面的代码中写入确认框
Can anyone suggest me how to write the confirm box in code behind
与您使用JavaScript
的方式相同.
但是注册该功能从codbehind使用
ClientScript.RegisterStartupScript(this.GetType(), "Confirm",<br />"<script>Confirm(''" + Are You Sure ?+ "'');</script>");<br />
或者如果在页面中使用ajax,则ScriptManager
ClientScript状态
Same way that your are doing using JavaScript
.
But Register that function from codbehind usingClientScript.RegisterStartupScript(this.GetType(), "Confirm",<br />"<script>Confirm(''" + Are You Sure ?+ "'');</script>");<br />
or if use ajax in your page then ScriptManager
instate of ClientScript
这篇关于从代码隐藏页面显示确认框,并输入是或否以供进一步使用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!