MessageBox

J

John Baima

When I run my ASP.NET app in the debugger,
System.Windows.Forms.MessageBox.Show works when running on the server.
It does not work when I actually upload my web site to the web server.
That is really annoying! I wish it would not work in the debugger!
Things should not work differently like that.

Anyway, I am looking for alternatives. I can do something like:

Response.Write("<script>alert('hello');</script>");

from the server side, but I cannot specify the title, and there is no
return value. Yes/No MessageBoxes are useful! Is there any better
option? I really would like something that can be launched from the
server side that displays some text and can post back some kind of
result. Is that possible?

BTW, I don't think that I've seen a mention of the ASP.NET faq at:

http://www.syncfusion.com/faq/aspnet/default.aspx

That really is a useful document.

-John
 
D

Damien

John said:
When I run my ASP.NET app in the debugger,
System.Windows.Forms.MessageBox.Show works when running on the server.
It does not work when I actually upload my web site to the web server.
That is really annoying! I wish it would not work in the debugger!
Things should not work differently like that.
You're writing an *ASP.NET* application, and you use a UI element from
under the System.*Windows.Forms* namespace, and you expect it to
work? said:
Anyway, I am looking for alternatives. I can do something like:

Response.Write("<script>alert('hello');</script>");

from the server side, but I cannot specify the title, and there is no
return value. Yes/No MessageBoxes are useful! Is there any better
option? I really would like something that can be launched from the
server side that displays some text and can post back some kind of
result. Is that possible?
The only ways to get something new to appear on the client side in
response to a server side decision is to inject script, as you've shown
above. Your options are alert(), confirm() or to inect an HTML form
which targets _blank and use your script to submit the form (you can do
this if you need really rich content in your popup box). Of course, if
you need to know the result of the confirm() on the server side, you'll
have to have more javascript which sets a hidden form input and then
submits the ASP.Net form.

I believe some people have created frameworks which hide a lot of the
detail of this for you.

Damien
 
J

John Baima

Damien said:
You're writing an *ASP.NET* application, and you use a UI element from
under the System.*Windows.Forms* namespace, and you expect it to
work?</sarcasm>

Well, no, I guess not. But I wanted that functionality, so I tried it,
and it did work when I was debugging. Why is that??
I believe some people have created frameworks which hide a lot of the
detail of this for you.

Links? Thanks.

-John
 
M

Mark Rae

Well, no, I guess not. But I wanted that functionality, so I tried it,
and it did work when I was debugging. Why is that??

Presumably because you're development box has a local copy of IIS, so it's
both server and client...

Google...
 

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,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top