Solved

Strict vbScript redirect method (no asp)

Posted on 2001-07-09
2
470 Views
Last Modified: 2007-11-27
How can you do a redirect with vbScript without using the response object in ASP?  Here is the code...

<SCRIPT LANGUAGE=vbScript>
sub deleteBtn_OnClick()
     lngControl = MsgBox("Are you sure you want to delete this order?",vbOKCANCEL,"WARNING! YOU ARE ABOUT TO DELETE!")

     If lngControl = vbOk THEN
          response.redirect "orders.asp?action=delete&ID=" & currentID
     End If
End sub
</SCRIPT>

Obviously the redirect doesn't work because it's not in asp, but just vbScript... I realize it's a little wierd to post a non asp question in the asp area, but I figured the people here would know more about vbScript...

Thanks!
0
Comment
Question by:mcneil
2 Comments
 
LVL 3

Accepted Solution

by:
phuctran earned 50 total points
ID: 6267191
is it client-side code?
try to use document.location="abc.com?parm1=1"
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6267424
I assume currentID is declared somewhere.

<SCRIPT LANGUAGE=vbScript>
sub deleteBtn_OnClick()
    lngControl = MsgBox("Are you sure you want to delete this order?",vbOKCANCEL,"WARNING! YOU ARE ABOUT TO DELETE!")

    If lngControl = vbOk THEN
         document.location = "orders.asp?action=delete&ID=" & currentID
    End If
End sub
</SCRIPT>


Note the danger of using VBScript at client side scripting language because it works only on IE and not on Netscape.

hongjun
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question