空文本框构造< ok>或者< cancle>。如果可以做其他事情拒绝该应用程序 [英] Empty text box conformation <ok> or <cancle>.if it is ok do something else reject the application

查看:86
本文介绍了空文本框构造< ok>或者< cancle>。如果可以做其他事情拒绝该应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用asp.net web应用程序中的以下消息框。现在我想将此消息框转换为确认消息框并在其为真时执行其他操作意味着拒绝该应用程序。

如何使用If条件



我尝试过:



ScriptManager.RegisterStartupScript(this,this.GetType(),script ,确认('地址,电话号码,电子邮件ID是空的,你想继续');,true);

Am using the below message box in asp.net web application. Now i want to convert this message box as a confirmation message box and do something when it is true else means reject the application.
How do I use If condition here

What I have tried:

ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "confirm('Address,Phone Number,Email ID Is Empty Do You Want To Continue');", true);

推荐答案

使用JavaScript window.confirm 如果(如果没有,如果那么为什么?很清楚地解释了,例如,这里: Window.confirm() - Web API | MDN [ ^ ]。



但它可以被认为是一个很好的解决方案吗?我不会这么说,不是为了生产质量的应用程序。这些方法根据平台和浏览器提供难看的外观,可能与您的应用程序样式不一致,而且灵活性极差。



这样会好得多在网页中开发类似模态的行为,并使用JavaScript在本地完成。第一个解决方案是: https://jqueryui.com/dialog [ ^ ]。



此外,还有很多第三方jQuery插件,统称为模态弹出窗口,具有不同的效果,例如过渡,特别是页面其余部分的变暗。请参阅: http://bfy.tw/AJH [ ^ ]。



如果您需要学习jQuery(强烈推荐),请参阅:

http://en.wikipedia.org/wiki/JQuery

http://jquery.com

http://learn.jquery.com

http: //learn.jquery.com/using-jquery-core

http://learn.jquery.com/about-jquery/how-jquery-works (从这里开始)。



但是你不必这样做。在我的文章 Modal Popup From Scratch 中,我将解释如何解释它并解释此设计元素背后的行为和基本原理。



-SA
The use of JavaScript window.confirm with if (if not with if then why?) is quite clearly explained, for example, here: Window.confirm() - Web APIs | MDN[^].

But could it be considered as a good solution? I would not say so, not for production-quality applications. Such methods give ugly look depending on the platform and browser, which may not be in line with your application styles, and badly limited in flexibility.

It would be much better to develop modal-like behavior inside a Web page, and do it fully locally, with JavaScript. The first solution would be this: https://jqueryui.com/dialog[^].

Also, there are many 3rd-party jQuery plug-ins, collectively known as "modal popup", with different effects, such as transitions, and, notably, dimming of the rest of the page. Please see: http://bfy.tw/AJH[^].

If you need to learn jQuery (highly recommended), please see:
http://en.wikipedia.org/wiki/JQuery,
http://jquery.com,
http://learn.jquery.com,
http://learn.jquery.com/using-jquery-core,
http://learn.jquery.com/about-jquery/how-jquery-works (start from here).

But you don't have to do it like that. In my article Modal Popup From Scratch I explain how to it and explain the behavior and the rationale behind this design element.

—SA


这篇关于空文本框构造< ok>或者< cancle>。如果可以做其他事情拒绝该应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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