我应该在我的应用程序中添加哪个引用来显示消息框? [英] Which reference i should add in my application for displaying message box?

查看:103
本文介绍了我应该在我的应用程序中添加哪个引用来显示消息框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Asp.net网站上,我想显示一个消息框。我试过了

In my Asp.net website i want to display one message box. I tried

System.Windows.Forms;



但收到的错误消息为:


but am getting error message as;

Error	2	The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

推荐答案

System.Windows.Forms.MessageBox.Show

适用于Windows表单而不是Web表单



您可以使用像

is for Windows forms not web forms

You can instead display an alert using javascript alert like

Response.Write("<script type='text/javascript'> alert('your message here.')</script>");





问候

Pawan



Regards
Pawan


asp.net中没有消息框的直接支持。一种替代方法是你可以使用javascript来显示警告。
There is no direct suport for message box in asp.net. One alternative is you can use javascript to display an alert.


这是asp.net我们没有像windows窗体这样的直接消息框,但是有使用javascripts的确认框或警报消息或弹出窗口

ASP.NET中的简单MessageBox功能 [ ^ ]

ASP.NET MessageBox [ ^ ]

ASP.Net消息框警报显示 [ ^ ]

here是使用javascript的简单示例:

Here is asp.net we do not have direct message box like windows forms but have confirmatation box or alerts message or popups using javascripts
Simple MessageBox functionality in ASP.NET[^]
ASP.NET MessageBox[^]
ASP.Net Message Box Alert Display[^]
here is simple example using javascript:
<html>
 <head>
 <script>
 function display_alert()
   {
   alert("Hello! I am an alert box!!");
   }
 </script>
 </head>
 <body>

<input type="button" onclick="display_alert()" value="Display alert box">

</body>
 </html>





希望它帮助< br $>


Happy Coding !!



hope it helped

Happy Coding!!


这篇关于我应该在我的应用程序中添加哪个引用来显示消息框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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