IIS ASP - Message Box At Any Time

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > March 2006 > Message Box At Any Time





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Message Box At Any Time
Ben

2006-03-25, 11:59 am

Hello,

I am trying to convert a windows app to a web app and I have come accross a
problem I was hoping someone could help with.

Im creating a page where the user inputs some values and presses 'submit'.
I have the code done for the click even of the submit button, however I need
to create a message box with 2 buttons. These buttons will be used to
redirect the user to another page based on which button was pressed. I need
the message box to return a value so that I could determine which button was
pressed.

How can I accomplish this? Thanks!
ben
Ray Costanzo [MVP]

2006-03-25, 11:59 am

Windows apps and Web apps are incredibly different from each other. Without
deviating into the world of client-side VBScript, which you should never do,
you have to stick with what is available in the world of Web browsers. That
is to use client-side Javascript. Your options are "confirm" and "alert".
Confirm gives "OK" and "Cancel," in most, if not all, browser, and "alert"
just gives an OK button.


You could do something weak like:
<script type="text/javascript">
if(confirm('Click OK to go to location 1. Click cancel to go to location
2')) {
location.href = 'page1.asp';
} else {
location.href = 'page2.asp';
}
</script>


Or, create a new Web page that has two buttons or links or whatever on them
and make them say whatever you want and take the person wherever you like.

Ray at work


"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:BE096576-BA6A-4285-ACFA-A453B2C952B8@microsoft.com...
> Hello,
>
> I am trying to convert a windows app to a web app and I have come accross
> a
> problem I was hoping someone could help with.
>
> Im creating a page where the user inputs some values and presses 'submit'.
> I have the code done for the click even of the submit button, however I
> need
> to create a message box with 2 buttons. These buttons will be used to
> redirect the user to another page based on which button was pressed. I
> need
> the message box to return a value so that I could determine which button
> was
> pressed.
>
> How can I accomplish this? Thanks!
> ben



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com