473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

how to make a message box

Hi, I want to have a message box prompted out in the browser, just like what
normal windows application does (DoModal). How can I do it if using the
ASP.NET? Thanks a lot.

Regards,
Aug 2 '06 #1
4 1241
"ghostwolf" <yl***@roctec.com.hkwrote in message
news:Op***************@TK2MSFTNGP05.phx.gbl...
Hi, I want to have a message box prompted out in the browser, just like
what normal windows application does (DoModal). How can I do it if using
the ASP.NET? Thanks a lot.
Use the JavaScript alert(' ') function
Aug 2 '06 #2
This can be achived by registering a client side script (javascript) using
RegisterClientScript method.

let me know if this helps.

"ghostwolf" wrote:
Hi, I want to have a message box prompted out in the browser, just like what
normal windows application does (DoModal). How can I do it if using the
ASP.NET? Thanks a lot.

Regards,
Aug 2 '06 #3
I generally, in my Function Library, have a Subroutine called
DisplayMessage - but you can call it MsgBox or anything else - here's how it
is written:

Public Sub DisplayMessage(ByVal webPage As Object, ByVal Message As String)
Dim msgDisplay As String = "<script language='JavaScript'>alert('" &
Replace(Message, "'", "\'") & "');</script>"
webPage.ClientScript.RegisterStartupScript(Me.GetT ype, "DisplayMessage",
msgDisplay)
End Sub

Then, to use it, inside your page, just do this:
DisplayMessage(me, "This is my message")

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

"ghostwolf" <yl***@roctec.com.hkwrote in message
news:Op***************@TK2MSFTNGP05.phx.gbl...
Hi, I want to have a message box prompted out in the browser, just like
what
normal windows application does (DoModal). How can I do it if using the
ASP.NET? Thanks a lot.

Regards,


Aug 2 '06 #4
Thanks.

If I call the function in this way,

public void FunctionA()
{
int a = 0;
DisplayMessage(this, "This is my message");
int b =0;
}

the DisplayMessage is not DoModal, it will shown the message box and proceed to the code "int b=0" without the user to click the "OK" button.
And I want the message box can hold up the thread and block the user until he click the "OK" button to proceed.

Thanks in millions.

"David Wier" <da********@noSpamhotmail.comwrote in message news:e%****************@TK2MSFTNGP04.phx.gbl...
>I generally, in my Function Library, have a Subroutine called
DisplayMessage - but you can call it MsgBox or anything else - here's how it
is written:

Public Sub DisplayMessage(ByVal webPage As Object, ByVal Message As String)
Dim msgDisplay As String = "<script language='JavaScript'>alert('" &
Replace(Message, "'", "\'") & "');</script>"
webPage.ClientScript.RegisterStartupScript(Me.GetT ype, "DisplayMessage",
msgDisplay)
End Sub

Then, to use it, inside your page, just do this:
DisplayMessage(me, "This is my message")

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

"ghostwolf" <yl***@roctec.com.hkwrote in message
news:Op***************@TK2MSFTNGP05.phx.gbl...
>Hi, I want to have a message box prompted out in the browser, just like
what
>normal windows application does (DoModal). How can I do it if using the
ASP.NET? Thanks a lot.

Regards,

Aug 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jeremy S. | last post by:
Sorry if this is too far OT - I posted this in the IIS group and got no response - so here goes: What would be a good or recommended way to make a Web site in IIS6 inaccessible to users on the...
19
by: Swaregirl | last post by:
Hello, I would like to build a website using ASP.NET. I would like website visitors to be able to download code that I would like to make available to them and that would be residing on my...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
17
by: stubbsie | last post by:
Hi, I have redesigned our official public government website in .net and it has taken me a few months to redo. I have been the sole designer of the website from its humble beginnning a few years...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.