Home | Advertising Info8 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, January 16, 2025  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: Run VBScript from Button A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
amonteath
Newbie
Newbie
Avatar

Joined: June/10/2004
Location: United States
Online Status: Offline
Info: 3
Added: November/18/2004 at 3:38pm | IP Logged Quote amonteath

I am trying to run a serverside function to delete an order & then redirect to another page. It does not seem to work. Below is ther relevant part of the page:

'Cancel the Order **************
Function CancelOrder()
Dim SQLDelOrd
SQLDelOrd = "DELETE tblOrders_temp.OrderID, * FROM tblOrders_temp WHERE (((tblOrders_temp.OrderID)=" & OrdID & "));"

objConn.Execute(SQLDelOrd)

Response.Clear
Response.Redirect "MenuForRegisteredUsers.asp"
End Function
%>

<table Width = 100%>
<tr>
<td width="30%" valign="top" height="38">&nbsp;</td>
<td width="20%" valign="top"  align=Center height="38"><BUTTON TYPE="SUBMIT" NAME="Sub" >View Your Order</BUTTON>
 </td>
<td width="20%" valign="top" align=Center height="38">
<BUTTON TYPE="Button" onClick ="CancelOrder()"> Cancel - Back to Registered Accounts Menu</BUTTON>
 </td>
<td width="30%" valign="top" height="38">&nbsp;</td>
</tr>
</table>
</FORM>

Thanks,

Alan

 



__________________

Alan
Back to Top View amonteath's Profile Search for other info by amonteath
 
cwilliams
Admin Group
Admin Group
Avatar

Joined: April/26/2004
Location: United States
Online Status: Offline
Info: 137
Added: November/18/2004 at 6:38pm | IP Logged Quote cwilliams

you cant do that... your function is server side and your button is client side to say the least...

ASP doesn't work like that. If you want to things to happen you have to have forms post to pages or have users click on hyperlinks.

__________________


Chris Williams
http://www.PowerASP.com
Back to Top View cwilliams's Profile Search for other info by cwilliams
 
amonteath
Newbie
Newbie
Avatar

Joined: June/10/2004
Location: United States
Online Status: Offline
Info: 3
Added: November/18/2004 at 7:09pm | IP Logged Quote amonteath

Thanks Chris. I understand. Is there not a way to run serverside code from a button? At least I would like to open an asp page so I could run the code there & redirect to the next page. How coul I do that from a button?

 

The reason I am asking about a button is that I already have a submit type button on the form. This button will make the two field values available for the next page. However, with this button, I need to initiate a delete query on the server and redirect to an earlier menu page. Any suggestions?

Thanks for your help.



__________________

Alan
Back to Top View amonteath's Profile Search for other info by amonteath
 
cwilliams
Admin Group
Admin Group
Avatar

Joined: April/26/2004
Location: United States
Online Status: Offline
Info: 137
Added: November/18/2004 at 9:22pm | IP Logged Quote cwilliams

I dont have any ideas.. you'll have to come up with something clever is the answer. In asp.net that sort of thing much easier to accomplish.

Edited by cwilliams on November/19/2004 at 5:08pm


__________________


Chris Williams
http://www.PowerASP.com
Back to Top View cwilliams's Profile Search for other info by cwilliams
 
amonteath
Newbie
Newbie
Avatar

Joined: June/10/2004
Location: United States
Online Status: Offline
Info: 3
Added: November/18/2004 at 10:32pm | IP Logged Quote amonteath

In thinking about it, I think the answer is just to use two submit buttons, each doing its own thing.

 

Thanks again for being patient with newbie stumblings.

 

 



__________________

Alan
Back to Top View amonteath's Profile Search for other info by amonteath
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com