从代码隐藏页面显示确认框,并输入是或否以供进一步使用. [英] Display A Confirm Box from a CodeBehind Page and Take Input Yes or No for further use.

查看:112
本文介绍了从代码隐藏页面显示确认框,并输入是或否以供进一步使用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

有人可以建议我如何在后面的代码中写入确认框吗?无论用户单击确定"还是"
",我都想获得返回值'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

推荐答案

koushiksaha写道:
koushiksaha wrote:

有人可以建议我如何在后面的代码中写入确认框

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 using

ClientScript.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆