如何在asp.net中使用消息框 [英] How to use a messagebox in asp.net

查看:75
本文介绍了如何在asp.net中使用消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我制作了一个小型的ASP.net网页,在其中我使用了一个消息框来确认

,然后才会执行。

它在本地测试时工作正常,但是当我在服务器上发布它时,它已经不再工作了。


我理解为什么,但仍然有问题,我希望用户在执行开始之前先确认
确认。


如何完成?

我搜索了一下并找到了javascript解决方案,但是如何在我的

代码中使用它们?


我的代码看起来像什么像这样:

昏暗的东西

result = MsgBox(MsgText.ToString,MsgBoxStyle.YesNo +

MsgBoxStyle.MsgBoxSetForeground," title")


如果结果= vbYes则

开始执行

否则

一些代码

结束如果


-

问候,


Arvid

解决方案

你在MsgBox背后有什么?

你在另一个例程中使用Javascript吗?

没有这样的ASP.Net内在控件 - 但是有在Ajax工具包中是一个

ConfirmButton。


-

David Wier

MVP / ASPInsider
http://aspnet101.com
http://aspexpress.com

" Arvid" < Ar *** @ discuss.microsoft.com写信息

news:96 ************************* ********* @ microsof t.com ...





我做了一个小的ASP.net网页,在其中我使用了一个消息框来确认

,然后才会执行。

它在本地测试时工作正常,但是当我发布在



服务器


它再也不能用了。


我理解为什么,但仍有问题,我希望用户在执行开始前先确认
确认。


如何它完成了吗?

我搜索了一下并找到了javascript解决方案,但是如何在我的

代码中使用它们?


我的代码看起来像这样:

昏暗的东西

result = MsgBox(MsgText.ToString,MsgBoxStyle.YesNo +

MsgBoxStyle.MsgBoxSetForeground," ; TI tle")


如果result = vbYes那么

开始执行

否则

一些代码

结束如果


-

问候,


Arvid



这可以帮到你:

http://usableasp.net/DeveloperPage.a...rAndClient.htm


-

Eliyahu Goldin,

软件开发人员&顾问

Microsoft MVP [ASP.NET]
http: //msmvps.com/blogs/egoldin
http://usableasp.net

" Arvid" < Ar *** @ discuss.microsoft.com写信息

news:96 ************************* ********* @ microsof t.com ...





我做了一个小的ASP.net网页,在其中我使用了一个消息框来确认

,然后才会执行。

它在本地测试时工作正常,但是当我将它发布在

服务器上

它再也不能用了。


我明白为什么,但仍然有问题我希望用户在执行开始前先确认
确认。


怎么做?

我搜索了一下并找到了javascript解决方案,但是如何在我的

代码中使用它们?


我的代码看起来像这样:

Dim有些事情

result = MsgBox(MsgText.ToString,MsgBoxStyle.YesNo +

MsgBoxStyle.MsgBoxSetForeground," title")


如果result = vbYes那么

开始执行

否则

一些代码

结束如果


-

问候,


Arvid



怎么做?


你不是。如果你想要用户交互,它必须通过客户端上的javascript来完成,而不是服务器端代码。如果您在asp.net代码中使用消息框

该框出现在服务器上,没有人可以点击它,当然不是那个意图客户端的b $ b。 />

Hi,

I made a small ASP.net web page and in it I used a messagebox to confirm
first before an execution would take place.
It worked fine while testing it locally, but when i published it on a server
it didn''t work anymore.

I understand why, but still have the problem that I would like the user to
confirm first before execution begins.

How is it done?
I searched a bit and found javascript solution but how do I fit them in my
code?

My code looks something like this :
Dim somethings
result = MsgBox(MsgText.ToString, MsgBoxStyle.YesNo +
MsgBoxStyle.MsgBoxSetForeground, "title")

If result = vbYes Then
start execution
Else
some code
End If

--
regards,

Arvid

解决方案

What do you have behind the MsgBox?
Are you using Javascript in another routine?
There is no ASP.Net intrinsic control like this - however there is a
ConfirmButton in the Ajax toolkit.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"Arvid" <Ar***@discussions.microsoft.comwrote in message
news:96**********************************@microsof t.com...

Hi,

I made a small ASP.net web page and in it I used a messagebox to confirm
first before an execution would take place.
It worked fine while testing it locally, but when i published it on a

server

it didn''t work anymore.

I understand why, but still have the problem that I would like the user to
confirm first before execution begins.

How is it done?
I searched a bit and found javascript solution but how do I fit them in my
code?

My code looks something like this :
Dim somethings
result = MsgBox(MsgText.ToString, MsgBoxStyle.YesNo +
MsgBoxStyle.MsgBoxSetForeground, "title")

If result = vbYes Then
start execution
Else
some code
End If

--
regards,

Arvid



This can help you:

http://usableasp.net/DeveloperPage.a...rAndClient.htm

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Arvid" <Ar***@discussions.microsoft.comwrote in message
news:96**********************************@microsof t.com...

Hi,

I made a small ASP.net web page and in it I used a messagebox to confirm
first before an execution would take place.
It worked fine while testing it locally, but when i published it on a
server
it didn''t work anymore.

I understand why, but still have the problem that I would like the user to
confirm first before execution begins.

How is it done?
I searched a bit and found javascript solution but how do I fit them in my
code?

My code looks something like this :
Dim somethings
result = MsgBox(MsgText.ToString, MsgBoxStyle.YesNo +
MsgBoxStyle.MsgBoxSetForeground, "title")

If result = vbYes Then
start execution
Else
some code
End If

--
regards,

Arvid



How is it done?

You don''t. If you want user interaction it has to be done via javascript on
the client, not server-side code. If you use message boxes in asp.net code
the box appears on the server and no-one is there to click it, certainly not
the intented client.


这篇关于如何在asp.net中使用消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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