ASP.NET Messagebox


T

tma

How are message boxes (not the browser pop-up variety but rather the .NET
msgbox) achieved in ASP.NET?
 
Ad

Advertisements

A

Arran Pearce

If your not talking about browser pop-up what results are you expecting?
Something like the javascript alert box?

remember asp.net is server side code, if you want to do any form of
window control you have to output client side code.
 
M

Marina

You can't. How could you? It would mean a server side messagebox, not a
client side one. It would also mean that the client would have to have the
..NET framework.

You can use embedded windows forms controls in asp.net pages, but now you
are talking about major security configuration issues and requiring clients
to install the .net framework all so they could have a different
messagebox...
 
T

tma

I'm not familiar with a JavaScript alert box, but I see how this question
seems stupid given what has been pointed out in the replies. I'm (obviously)
a novice at this .NET stuff and struggle putting together what I experience
versus what I can deliver via Visual Studio.

Thank you both for the speedy replies!
 
B

Brian Henry

all you have is either

window.open
window.showModalDialog
or
alert() in javascript to do this
 
Ad

Advertisements

S

Steve C. Orr [MVP, MCSD]

You can execute a line of code like this when you want a message box to be
displayed.
(This writes out the necessary client side javascript to your HTML page to
make the alert pop up as soon as the page is sent to their browser.)

RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('This is my message.');</script>");

Here's more info:
http://msdn.microsoft.com/library/d...mWebUIPageClassRegisterStartupScriptTopic.asp

Here are a couple controls you might find to be useful:
http://www.metabuilders.com/Tools/ConfirmedButtons.aspx
http://www.jttz.com/msgbox/index.htm
 

Top