需要帮助在Web应用程序的C#代码中生成确认弹出窗口。 [英] Need help to generate confirm pop-up in C# code for web application.

查看:75
本文介绍了需要帮助在Web应用程序的C#代码中生成确认弹出窗口。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在使用C#,。Net和ASPX创建一个Web应用程序。我想在C#代码中生成确认弹出窗口,在某个地方随机询问用户的问题,并以(是,否),(确定,取消),(真,假)的形式得到答复。任何帮助都将非常感激。

谢谢你

Hello, I am creating a web application in C#, .Net and ASPX. And I want to generate confirm popup in C# code to ask question from user randomly at some place and get reply in form of (yes, no) , (ok, cancel) , (true, false). Any help will be really appreciated.
Thank you

推荐答案

你不想在C#中这样做。当有人访问您的页面时,您的服务器会编译并执行您的代码并生成html并将html发送到客户端然后断开连接。要提示用户提供信息,您需要使用JavaScript,我建议不要尝试使用C#来执行JavaScript,因为那时你必须有一个页面回发,这是一个糟糕的形式。



jQueryUI还有一个很好的.dialog()函数,可以很容易地为此实现。如果你使用ASP.Net,你也必须使用Javascript,所以也可以习惯它。
You do not want to do this in C#. When someone visits your page, your server compiles and executes your code and generates html and sends the html to the client and then disconnects. To prompt for information from user you need to use JavaScript and I would recommend against trying to use C# to execute the JavaScript because then you have to have a page postback which is bad form for this.

jQueryUI also has a nice .dialog() function that can be easily implemented for this. If you do ASP.Net you have to also use Javascript so may as well get used to it.


这篇关于需要帮助在Web应用程序的C#代码中生成确认弹出窗口。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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