How do you pop up a message (like messagebox.show)?

V

VB Programmer

I would like my error handler to pop up a message on my webform. How do you
do this?

Currently I'm using System.Web.HttpContext.Current.Response.Write("MY
ERROR")

Any ideas? Thanks!
 
V

VB Programmer

I wanted to pop up a message whenever my general error handling routing was
run. The message would tell the user what the error was. Do I have to
DYNAMICALLY place this alert message on the offending page? If so, can you
post an example of how to do this?
 
S

Scott M.

There are a couple of ways but this works:

If yourCodeThatChecksForAnError then
response.write("<Script
Language='JavaScript'>alert(yourErrorMessage)</Script>")
End If
 
D

Darrin J Olson

Another good way is to use the 'RegisterClientScriptBlock' method, and pass
it the '<Script> ... </Script>' string with the javascript you would like
to use.

-Darrin
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top