Msg box function equivalent in ASP.NET

P

PatLaf

Does anybody have a sample of how to msgbox the user in
asp.net? I've seen some examples but I am not sure how to
implement them. If anybody has an example of how to use
either the alert function or msgbox in the codebehind
page I would greatly appreciate the help.

Thanks in advance,
Pat Laf

BTW I've seen the ASK the PRO response but I am not clear
how to implement the code in the codebehind page.
 
J

Jeffrey Tan[MSFT]

Hi PatLaf,

Thanks for posting in this group.
Asp.net just encapsulates the HTML element. So it also will use client
script to do things.
To show message box in web form, you should use client script function:
alert, confirm, prompt.
For more information about these functions, please refer to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/ht
ml/jsUsingMessageBoxes.asp

To add client message box script in asp.net, you can use
HtmlTextWriter.WriteAttribute to associate it with some client event. Or
you can use Page.RegisterClientScriptBlock to inject the script into the
client side.

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top