Msgbox到asp客户端? [英] Msgbox to asp client?

查看:51
本文介绍了Msgbox到asp客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个我在常用asp中使用的VB.NET dll。


我的问题是从dll到Ie客户端获取消息,我可以看到IIS服务器上的Eventlog中的消息,所以我知道它们在那里,但我如何让它们在IE中显示?


原始代码是:

MsgBox(" Kunne ikke finde databasenavn udfra den angivne DSN:& DSN)

我试图将其更改为:


结果= MessageBox .Show(" Kunne ikke finde databasenavn udfra den angivne DSN:& DSN," Fejl",MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1,MessageBoxOptions.DefaultDesktopOnly,False)

>
但他们仍然没有出现在客户端,所以我该怎么做?


谢谢


Betina

解决方案

请记住,DLL运行服务器端,因此消息框显示

服务器side(实际上写在日志中,因为它在非交互式

上下文中运行)。


要显示消息客户端,您必须将其发送到

响应中的浏览器(无论是纯HTML还是客户端脚本,在消息框中显示此

)。

DLL可能会引发异常,表明它有问题。


在这种特殊情况下(看起来像是技术错误消息),我的个人

首选项是向用户显示一条通用消息,并警告支持团队支持
(毕竟用户除了

之外无法做任何事情,如果调用支持团队的话) DSN未定义。


-

Patrice


" Betina Andersen" <by*@invalid.comaécritdansle message de news:
OL **************@TK2MSFTNGP04.phx.gbl ...

我继承了我从普通asp使用的VB.NET dll 。


我的问题是从dll到Ie客户端获取消息,我可以在IIS服务器上的事件日志中看到

消息所以我知道他们在那里,但是

如何让他们在IE中显示?


原始代码是:

MsgBox (Kunne ikke finde databasenavn udfra den angivne DSN:& DSN)

我试图将其更改为:


结果= MessageBox.Show (Kunne ikke finde databasenavn udfra den angivne

DSN:& DSN," Fejl",MessageBoxButtons.OK,MessageBoxIcon.Error,

MessageBoxDefaultButton.Button1 ,MessageBoxOptions.DefaultDesktopOnly,

False)


但他们仍然没有出现在客户端上,所以我该怎么做那个?


谢谢


Betina


为了使用相同的代码对于winforms和webforms,一个人不能使用直接控件(标签,进度条,文本框)或msgbox。


你可以定义一个发出消息的abract messenger(例如:statusmsg,

errormsg,logmsg等)。

根据上下文(winforms / webforms),你将绑定事件

(或者代表)信使控制(winforms)或

到某种网络输出(响应,网页表格上的标签等)......


我发现这种机制非常方便,因为它允许使用

相同的代码用于winforms或webforms。

它清楚地将程序逻辑与GUI分开。


-tom


Betina Andersen ha scritto:


我继承了我使用普通asp的VB.NET DLL。


我的p roblem是从dll获取消息到Ie客户端,我可以在IIS服务器上的Eventlog中看到消息,所以我知道它们在那里,但是如何让它们在IE中显示?


原始代码是:

MsgBox(" Kunne ikke finde databasenavn udfra den angivne DSN:" &安培; DSN)

我试图将其改为:


结果= MessageBox.Show(" Kunne ikke finde databasenavn udfra den angivne DSN:&& DSN,Fejl,MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1,MessageBoxOptions.DefaultDesktopOnly,False)


但是他们仍然没有出现在客户端上,那怎么做我这样做了吗?


谢谢


Betina


------ = _ NextPart_000_0006_01C6ACB4 .CDF36910

内容类型:text / html; charset = iso-8859-1

Content-Transfer-Encoding:quoted-printable

X-Google-AttachSize:1521


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">

< HTML>< HEAD>

< ; META http-equiv = Content-Type content =" text / html; charset = iso-8859-1">

< META content =" MSHTML 6.00.2900.2912" name = GENERATOR>

< STYLE>< / STYLE>

< / HEAD>

< BODY>

< DIV>< FONT face = Arial size = 2>我继承了我使用的VB.NET dll

普通的asp。< / FONT>< / DIV>

< DIV>< FONT face = Arial size = 2>< / FONT>& nbsp;< / DIV>

< DIV> < FONT face = Arial size = 2>我的问题是从客户端获取来自dll的消息到

,我可以在IIS服务器上的Eventlog中看到消息,所以我

知道他们在那里,但我如何让他们在IE中显示?< / FONT>< / DIV>

< DIV>< FONT face = Arial size = 2>< / FONT>& nbsp;< / DIV>

< DIV>< FONT face = Arial size = 2>原始代码为:< / FONT>< ; / DIV>

< DIV>< FONT face = Arial size = 2> MsgBox(" Kunne ikke finde databasenavn udfra den

angivne DSN:&& ; amp; DSN)< / FONT>< / DIV>

< P>< FONT face = Arial size = 2>我试图将其更改为:< / FONT>< / P>

< P>< FONT face = Arial size = 2> Result = MessageBox.Show(" Kunne ikke finde

databasenavn udfra den angivne DSN:" &放大器;放大器; DSN,Fejl,MessageBoxButtons.OK,

MessageBoxIcon.Error,MessageBoxDefaultButton.Button1,

MessageBoxOptions.DefaultDesktopOnly,False)< / FONT>< / P> ;

< P>< FONT face = Arial size = 2>但是它们仍然没有出现在客户端上,那么我怎么做?b $ b我这样做了吗?< / FONT>< / P>

< P>< FONT face = Arial size = 2>< / FONT>& nbsp;< / P>

< P>< FONT face = Arial size = 2>谢谢< / FONT>< / P>

< P>< FONT face = Arial size = 2> Betina< ; / FONT>< / P>< / BODY>< / HTML>

------ = _ NextPart_000_0006_01C6ACB4.CDF36910--


所以我必须将响应对象发送到我的DLL并在出错时返回它,

就是你说的那个?


问候Betina


" Patrice" < sc **** @ chez.comskrev i en meddelelse

新闻:%2 ****************** @ TK2MSFTNGP05.phx.gbl ...


请记住,DLL运行服务器端,因此消息框显示

服务器端(实际写入在日志中,它在非交互式的

上下文中运行。


要显示消息客户端,您必须将其发送到

响应(无论是纯HTML还是客户端脚本,在消息框中显示

)。

DLL可能引发异常表示它有问题。


在这种特殊情况下(看起来像是一个技术错误信息),我的个人喜好是显示一般信息给用户和

警告支持团队(毕竟用户不能做任何事情

否则如果DSN不是,请致电支持团队定义)。


-

Patrice

" Betina Andersen" <by*@invalid.comaécritdansle message de news:
OL **************@TK2MSFTNGP04.phx.gbl ...

我继承了我从普通asp使用的VB.NET dll 。


我的问题是从dll到Ie客户端获取消息,我可以在IIS服务器上的事件日志中看到

消息所以我知道他们在那里,

但是如何让它们在IE中显示?


原始代码是:

MsgBox (Kunne ikke finde databasenavn udfra den angivne DSN:& DSN)

我试图将其更改为:


结果= MessageBox.Show (Kunne ikke finde databasenavn udfra den angivne

DSN:& DSN," Fejl",MessageBoxButtons.OK,MessageBoxIcon.Error,

MessageBoxDefaultButton.Button1 ,MessageBoxOptions.DefaultDesktopOnly,

False)


但他们仍然没有出现在客户端上,所以我该怎么做t?


谢谢


Betina



I have inherited a VB.NET dll that I am using from common asp.

My problem is to get the messages from the dll to the Ie client, I can see the messages in the Eventlog on the IIS server so I know they are there, but how do I get them to show in IE?

The original code was:
MsgBox("Kunne ikke finde databasenavn udfra den angivne DSN: " & DSN)
I tried to change that to:

Result = MessageBox.Show("Kunne ikke finde databasenavn udfra den angivne DSN: " & DSN, "Fejl", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False)

But they still dont show up on the client, so how do I do that?

Thanks

Betina

解决方案

Keep in mind that the DLL runs server side so the message box is "shown"
server side (actually written in the log as it runs in a non interactive
context).

To show a message client side you have to send it to the browser in the
response (either as plain HTML or as a client side script that display this
in a message box).
The DLL could raise an exception to signal it has a problem.

In this particular case (looks like a technical error message), my personal
preference is rather to display a generic message to the user and to warn
the support team (after all the user won''t be able to do anything else than
calling the support team if the DSN is not defined).

--
Patrice

"Betina Andersen" <by*@invalid.coma écrit dans le message de news:
OL**************@TK2MSFTNGP04.phx.gbl...
I have inherited a VB.NET dll that I am using from common asp.

My problem is to get the messages from the dll to the Ie client, I can see
the messages in the Eventlog on the IIS server so I know they are there, but
how do I get them to show in IE?

The original code was:
MsgBox("Kunne ikke finde databasenavn udfra den angivne DSN: " & DSN)
I tried to change that to:

Result = MessageBox.Show("Kunne ikke finde databasenavn udfra den angivne
DSN: " & DSN, "Fejl", MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly,
False)

But they still dont show up on the client, so how do I do that?

Thanks

Betina


In order to use the same code for winforms and webforms one must not
use directly controls (labels, progressbars, textboxes) or msgboxes.

You can define an abract messenger which issue messages (ex: statusmsg,
errormsg, logmsg, etc ).
Depending on the context (winforms/webforms) you will bind the events
(or delegates) of the messenger to controls (winforms) or
to some kind of web output (response, labels on web forms, etc.) ...

I find very convenient this kind of mechanism, as it allows to use the
same code for winforms or webforms.
It separates clearly the program logic from the GUIs.

-tom

Betina Andersen ha scritto:

I have inherited a VB.NET dll that I am using from common asp.

My problem is to get the messages from the dll to the Ie client, I can see the messages in the Eventlog on the IIS server so I know they are there, but how do I get them to show in IE?

The original code was:
MsgBox("Kunne ikke finde databasenavn udfra den angivne DSN: " & DSN)
I tried to change that to:

Result = MessageBox.Show("Kunne ikke finde databasenavn udfra den angivne DSN: " & DSN, "Fejl", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False)

But they still dont show up on the client, so how do I do that?

Thanks

Betina

------=_NextPart_000_0006_01C6ACB4.CDF36910
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 1521

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>I have inherited a VB.NET dll that I am using from
common asp.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>My problem is to get the messages from the dll to
the Ie client, I can see the messages in the Eventlog on the IIS server so I
know they are there, but how do I get them to show in IE?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The original code was:</FONT></DIV>
<DIV><FONT face=Arial size=2>MsgBox("Kunne ikke finde databasenavn udfra den
angivne DSN: " &amp; DSN)</FONT></DIV>
<P><FONT face=Arial size=2>I tried to change that to:</FONT></P>
<P><FONT face=Arial size=2>Result = MessageBox.Show("Kunne ikke finde
databasenavn udfra den angivne DSN: " &amp; DSN, "Fejl", MessageBoxButtons.OK,
MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly, False)</FONT></P>
<P><FONT face=Arial size=2>But they still dont show up on the client, so how do
I do that?</FONT></P>
<P><FONT face=Arial size=2></FONT>&nbsp;</P>
<P><FONT face=Arial size=2>Thanks </FONT></P>
<P><FONT face=Arial size=2>Betina</FONT></P></BODY></HTML>

------=_NextPart_000_0006_01C6ACB4.CDF36910--


So will I have to send the Response Object to my DLL and return it on error,
is that what you are saying?

Regards Betina

"Patrice" <sc****@chez.comskrev i en meddelelse
news:%2******************@TK2MSFTNGP05.phx.gbl...

Keep in mind that the DLL runs server side so the message box is "shown"
server side (actually written in the log as it runs in a non interactive
context).

To show a message client side you have to send it to the browser in the
response (either as plain HTML or as a client side script that display
this in a message box).
The DLL could raise an exception to signal it has a problem.

In this particular case (looks like a technical error message), my
personal preference is rather to display a generic message to the user and
to warn the support team (after all the user won''t be able to do anything
else than calling the support team if the DSN is not defined).

--
Patrice

"Betina Andersen" <by*@invalid.coma écrit dans le message de news:
OL**************@TK2MSFTNGP04.phx.gbl...
I have inherited a VB.NET dll that I am using from common asp.

My problem is to get the messages from the dll to the Ie client, I can see
the messages in the Eventlog on the IIS server so I know they are there,
but how do I get them to show in IE?

The original code was:
MsgBox("Kunne ikke finde databasenavn udfra den angivne DSN: " & DSN)
I tried to change that to:

Result = MessageBox.Show("Kunne ikke finde databasenavn udfra den angivne
DSN: " & DSN, "Fejl", MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly,
False)

But they still dont show up on the client, so how do I do that?

Thanks

Betina



这篇关于Msgbox到asp客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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