HTML Linking

I have an ASP page with a form containing ActiveX components.  When I click a button I update a database using the ActiveX components and then I want to send the user to another page.  How do I send then to the next page?
obsrhaydenAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
JagarConnect With a Mentor Commented:
Try this in the On_Click event of you button first do your database stuff that at the end of the procedure put this line (it's in VBScript, if you use Java I'm sure you can change it to the correct syntax for Java)

document.href = "www.yoursite.com/NewPage.htm"

0
 
sybeCommented:
<%
Response.redirect("anotherpage.asp")
%>

This works only when there is no HTML output before this statement, not even <HTML>
0
 
obsrhaydenAuthor Commented:
There is HTML before this.  What I want are a series of buttons that when clicked execute some code and then send the user to a given page.
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
sybeCommented:
I do not understand your question quite clear.
Trying to understand:

You _have_ a page with buttons.

The user clicks a button and a database is updated. The way that that is done usually is that a form is send. So your page has a form with buttons.

Then when a button is clicked, the form is send to the server following <form action="response.asp">

On the server response.asp processes tha data from the form and updates the database, and sends a respons back to the browser.

But you want to redirect the browser to another page.

So that is why i wrote my answer. In response.asp use the code I proposed. If I got you wrong, then tell me where I do not understand your problem.


0
 
obsrhaydenAuthor Commented:
This is what I want,
- a page with various buttons
- when clicked each button preforms some VBscript and then send the various to a different page.
- each button may send the user to a different page
0
 
sybeCommented:
for example:

page 1:

===============
<form action="page2.asp">
....form fields ??....

<input type="submit" name="button1" value="button1">
<input type="submit" name="button2" value="button2">
<input type="submit" name="button3" value="button3">

</form>

==========================
page2.asp:
==========================

<%
' Doing some VB-stuff such as database updates
'
'
'
'
' and at the end:

If Request("button1") <> "" Then
  Response.redirect("page1.htm")
ElseIf Request("button2") <> "" Then
  Response.redirect("page2.htm")
ElseIf Request("button3") <> "" Then
  Response.redirect("page3.htm")
End If

%>

0
 
obsrhaydenAuthor Commented:
The problem is that I have two MSFlexGrids that the user can update.  These cannot be referenced from the next page so either I must update the database on the first page then move to the second page (how to do?) or build a string with the contents of the FlexGrid before submitting the form and useing it as a parameter(how to do?)  So if you could explain to me how to do one of the above I'd be very grateful
0
 
obsrhaydenAuthor Commented:
The problem is that I have two MSFlexGrids that the user can update.  These cannot be referenced from the next page so either I must update the database on the first page then move to the second page (how to do?) or build a string with the contents of the FlexGrid before submitting the form and useing it as a parameter(how to do?)  So if you could explain to me how to do one of the above I'd be very grateful
0
 
sybeCommented:
Hmm, so you want to use the MSFlexGrids to update the database. I don't know exactly what it is, except that I understand that it is an ActiveX control.
It all depends on the methods and properties of the MSFlexGrid. I thought you were talking about forms (that is what I usually associate "buttons" with when it comes to HTML).

I am afraid that if the MSFlexGrid has an onClick-method, that this will be performed before the database update, and that the database update won't take place.

If you know of a place were this ActiveX control is used, I could take a look at it.
0
 
obsrhaydenAuthor Commented:
Is actually
document.location.href = "www.monkey.com"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.