asp.net中的messagebox?怎么样? [英] messagebox in asp.net? how?
问题描述
大家好!
从未有过如此多的问题向用户显示消息
(过去4年是程序员) !
我想做的是显示一条消息,例如当一个程序失败等等。
尝试搜索谷歌,尝试使用div,设法在我的
母版页中植入一个div来显示信息和错误消息,
但我有两个问题:
1)下拉列表显示在这个div之上!
2)不能生成确认div(停止javascript代码并等待用户
互动)
所以,你会建议什么 - 推荐我?
提前致谢!
Hi everyone!
Never before have I had so many problems displaying a message to the user
(being a programmer for the last 4 years)!
What I would like to do is show a message e.g. when a procedure fails, etc.
Tried searching google, tried with divs, managed to ''implant'' a div in my
master page to show info and error messages,
but I have two problems with it:
1) dropdown''s display on top of this div!
2) can''t produce confirm div (stop the javascript code and wait for user
interaction)
So, what would you suggest - recommend me?
Thanks in advance!
推荐答案
" patrickdrd" < pa ******** @ discuss.microsoft.com写信息
news:97 ******************** ************** @ microsof t.com ...
"patrickdrd" <pa********@discussions.microsoft.comwrote in message
news:97**********************************@microsof t.com...
那么,你会建议什么 - 推荐我?
So, what would you suggest - recommend me?
你需要的两种JavaScript方法是''alert''和''确认''
http:// www.google.co.uk/search?hl=en...G=Search&meta=
由于您的ASP.NET代码在服务器,它是负责消息箱/确认/警报的客户端,你不能使用服务器端代码
直接执行此操作。
最简单的做法就是在页面上放置一个ASP:Label控件
你想要消息的位置,但是留下它文字专业perty
空白然后,当您的服务器端代码需要向客户端发送消息
时,只需填写标签的text属性即可。请记住将标签''
EnableViewState属性设置为false,这样您就不会看到旧消息。
或者,您可以使用服务器端用于生成客户端javascript的代码,
可以为您制作消息框:
如果someTest那么
response.write ("< SCRIPT LANGUAGE =''JavaScript''>提醒(''你已经完成了
坏事!'')< / SCRIPT>")
结束如果
-Scott
" patrickdrd" < pa ******** @ discuss.microsoft.com写信息
news:97 ******************** ************** @ microsof t.com ...
Since your ASP.NET code runs on the server and it is the client that is
responsible for messageboxes/confirms/alerts, you can''t use server-side code
to do this directly.
The simplest thing to do is just to put an ASP:Label control on the page in
the position you *would* want the message to go, but leave its text property
blank Then, when your server-side code needs to send the client a message
simply fill in the text property of the label. Remember to set the label''s
EnableViewState property to false so you don''t see old messages.
Or, you could use server-side code to produce client-side javascript, which
could make your messagebox for you:
If someTest Then
response.write("<SCRIPT LANGUAGE=''JavaScript''>alert(''You have done
something bad! '')</SCRIPT>")
End If
-Scott
"patrickdrd" <pa********@discussions.microsoft.comwrote in message
news:97**********************************@microsof t.com...
大家好!
从来没有向用户显示过这么多问题
(过去4年是程序员)!
我是什么我想做的就是展示一条消息,例如当一个程序失败时,
等
尝试搜索谷歌,尝试使用div,设法植入我的一个div?
母版页显示信息和错误消息,
但我有两个问题:
1)下拉列表显示在这个div的顶部!
2)无法生成确认div(停止javascript代码并等待用户
互动)
所以,你有什么建议 - 推荐我?
提前致谢!
Hi everyone!
Never before have I had so many problems displaying a message to the user
(being a programmer for the last 4 years)!
What I would like to do is show a message e.g. when a procedure fails,
etc.
Tried searching google, tried with divs, managed to ''implant'' a div in my
master page to show info and error messages,
but I have two problems with it:
1) dropdown''s display on top of this div!
2) can''t produce confirm div (stop the javascript code and wait for user
interaction)
So, what would you suggest - recommend me?
Thanks in advance!
对不起,但我忘了提到我需要显示服务器端
消息.. 。
我已经使用并了解警报并在javascript中确认
" Mark Rae"写道:
sorry about that, but I forgot to mention that I need to display server side
messages...
I already use and know about alert and confirm in javascript
"Mark Rae" wrote:
" patrickdrd" < pa ******** @ discuss.microsoft.com写信息
news:97 ******************** ************** @ microsof t.com ...
"patrickdrd" <pa********@discussions.microsoft.comwrote in message
news:97**********************************@microsof t.com...
那么,你会建议什么 - 推荐我?
So, what would you suggest - recommend me?
您需要的两种JavaScript方法是警报和确认
http://www.google.co.uk/search?sourc...vaScript+alert
http:// www.google.co.uk/search?hl=en...G=Search&meta=
这篇关于asp.net中的messagebox?怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!