Asp.net C#确认对话框后面的代码 [英] Asp.net C# confirm dialog box in code behind
本文介绍了Asp.net C#确认对话框后面的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
任何人都对Asp.net C#中的确认对话有所了解。
注意:C#代码背后
如果确认==是那么
A座应该执行
其他
B座应该执行
我尝试了什么:
Hi All,
Any one have an idea on Confirm Dialog in Asp.net C# .
Note: C# Code Behind
if Confirm=="Yes" Then
Block A Should execute
else
Block B Should excute
What I have tried:
I tried with RegisterStartupScript in Code Behind but it shows only at the end of execution.I tried with Javascript but it fires on Client side
推荐答案
你不能在网站上执行此操作:您必须使用Javascript和HTML对象与用户进行交互,在继续操作之前,您不要尝试在C#中立即获得响应。
见这里: Javascript使用C#从代码后面确认ASP.NET论坛 [ ^ ] - 它显示了一种方法。
You can't do that in a web site: you have to use Javascript and HTML objects to interact with the user, you don't try and get an immediate response in C# before continuing.
See here: Javascript confirm from code behind using C# | The ASP.NET Forums[^] - it shows one way to do it.
要求用户确认他们想要继续行动ASP.NET论坛 [ ^ ]
这篇关于Asp.net C#确认对话框后面的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文