Home All Groups Group Topic Archive Search About
Author
8 Sep 2006 11:56 AM
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

Author
8 Sep 2006 1:05 PM
Damien
John Baima wrote:
> 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?</sarcasm>

> 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
Are all your drivers up to date? click for free checkup

Author
8 Sep 2006 2:22 PM
John Baima
"Damien" <Damien_The_Unbelie***@hotmail.com> wrote:

>John Baima wrote:
>> 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?</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
Author
8 Sep 2006 3:22 PM
Mark Rae
"John Baima" <john@nospam.com> wrote in message
news:k1v2g2le1m0fkr9qlocfe14a7ohubtdbsn@4ax.com...

> 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...

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

Google...

Bookmark and Share