Hello,
The nature of ASP (Active Server Page) is to do some actions on server. ASP is using VBScript for that. (VBScript server-side)
MsgBox is part of VBScript, but it's nature is to diplay something to the client, so actually it is part of VBScript client-side.
So you cannot use MsgBox in your ASP code.
Possible solutions:
1) ASP - use Response.Write ("Message"
2) Client-side VBScript
<script language="VBScript">
MsgBox "Message"
</script>
Hope this helps.
D.
Is there a way to redirect the user to another page depending on the outcome of the button click in the MsgBox.
i.e. (this does not work because the ASP executes first) but you will get the idea.
<script Language=vbscript>
intButtonClicked = MsgBox("Do you wish to add another?",68, "Duplicate!"
if intButtonClicked = 6 then
'do nothing
End if
if intButtonClicked = 7 then
<%
Response.Redirect "singleFeedTSearch.asp"
%>
End if
</script>
Hello,
First my thought was that you will need the client-side VBScript function that returns user input - InputBox. Check MSDN for more information.
Dim UserInput
UserInput = InputBox("Enter your destination"
MsgBox ("You entered: " & UserInput)
Then I realise that you are asking for redirecting.
In ASP Response.Redirect immediately goes to specified URL.
Again in client-side VBScript you could use
window.location.href = "bbb.asp" or
document.location.href = "bbb.asp"
Thanks for your great suggestion. I had a msgbox that was being ignored because the response.redirect was hitting right away. Now, I have the window.location.href right under the msgbox code within the <Script> tag and it waits for the msgbox to redirect.
I have a similar issue, except I want to either include a hyperlink in the message box (not possible right?) or execute the hyperlink after the user presses OK. The link is not a page though, it is a .reg file to edit someone's registry settings. I need it to be in vbscript because it is part of a vbscript function that executes when the function has an error.
Visitor:
MsgBox and InputBox will work in client-side VBScript - it's just no-one would use client-side VBScript unless they had absolute control over what their audience browsed with - client-side VBScript only works for IE codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.