Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HTML Linking

Posted on 1998-07-23
10
Medium Priority
?
198 Views
Last Modified: 2013-12-25
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?
0
Comment
Question by:obsrhayden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1858623
<%
Response.redirect("anotherpage.asp")
%>

This works only when there is no HTML output before this statement, not even <HTML>
0
 

Author Comment

by:obsrhayden
ID: 1858624
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
 
LVL 28

Expert Comment

by:sybe
ID: 1858625
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
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 

Author Comment

by:obsrhayden
ID: 1858626
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
 
LVL 28

Expert Comment

by:sybe
ID: 1858627
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
 

Author Comment

by:obsrhayden
ID: 1858628
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
 

Author Comment

by:obsrhayden
ID: 1858629
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
 
LVL 2

Accepted Solution

by:
Jagar earned 360 total points
ID: 1858630
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
 
LVL 28

Expert Comment

by:sybe
ID: 1858631
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
 

Author Comment

by:obsrhayden
ID: 1858632
Is actually
document.location.href = "www.monkey.com"
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

688 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