I have asp program that reads information from the database and print the information to the table on a web page.
The reading happens trough a normal "do while not EOF" loop.
I have tried to make each data to a link. I mean that when the data is printed to the table, the program would also put a link to each data. When the user selects the link in the table, the program gets all of the information from the DB based on what link did the user pushed.
For example: the program gets different car marks from the db and then prints them out into a table. every mark in the table is also a link. When the user selects, for example a Toyota, the web page gets all the toyotas from the db and prints them out.
It feels like a simple problem but still I havent found a way to solve it. If somebody can give me a hint how I should proceed, please tell me.
<%
carid = request.querystring("carid")
carmark = request.querystring("carmark")
If LEN(carid) > 0 Then
select * FROM carlist where carid = '"& carid &"'"
table for car-details......
Else
If LEN(carmark) > 0 Then
select * FROM carlist where carid = '"& carid &"'"
Else
select * FROM carlist"
End If
%>
<tr><th>Car</th><th>Mark</th></tr>
<% Do While NOT RS.EOF %>
<tr><td><a href="cars.asp?carid=<%= RS("carid") %>">Fiat Panda</a></td><td><a href="cars.asp?mark=<%= RS("carmark") %>">Fiat</a></td></tr>
<% RS.Movenext
Loop
End If %>
if you want all links on a page to open in a new window u can also do <base target="_blank"> in the head section.. just thought id mention that since no1 ever uses <base> even though it can be prety useful
_blank is used a lot but a user-defined name is also allowed.
Sometimes I like to use a different user-defined name so that it will be sure to open in a new window (so that the focus is sure to move to there) instead of one that has already been opened (just a matter of preference I suppose).
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
Quote:
Originally Posted by Bullschmidt
Sometimes I like to use a different user-defined name so that it will be sure to open in a new window (so that the focus is sure to move to there)
For user-defined window target name (and if the window with that name is already opened), focus is only set if you explicitly call the focus() method. Unlike in _blank where the focus is always set to the newly opened window even without calling focus() method.