Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Message box in ASP

Author  Topic 

Mamatha
Posting Yak Master

102 Posts

Posted - 2005-01-04 : 05:01:48
Hi

I want to display message box with ok and cancel buttons in ASP,i used code like the following:

<SCRIPT LANGUAGE="VBSCRIPT">
<!--
Dim Answer
Answer = MsgBox ("File already exist,do you want to overwrite", 65, "Confirmation Message")
If Answer = 1 Then //for Ok

end if
If Answer = 2 Then //for cancel

end if

//-->
</script>

In the code i want to disply some ASP functions,i tried with runat=server also but message box was not worked.If i do like the above then ASP functions are not executed then how can i manage both with the same functionality.Please give me the solution.

Thanks in advance.


Mamatha

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-01-04 : 08:04:56
use a redirect to the page (or another page) with the answer... If the messagebox is shown client-side, then there needs to be some call back to the server for it to know what was selected.

Corey
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-01-04 : 08:05:31
A message box cannot run at the server. I never used client-side VBScript so I don't know if you get the same functionality as you would with VB/VBA.

I would recommend that instead of using a popup box, you should create regular web controls in a form. Popup message boxes in a web application are almost always used by unscrupulous web sites trying to download something onto your machine without your knowledge/approval, and most people will either block them or close them outright.
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2005-01-04 : 14:38:32
Use a javascript alert, or confirm statement.

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page
   

- Advertisement -