Author |
Topic |
|
paco
Junior Member
Spain
187 Posts |
Posted - 12 April 2001 : 11:25:39
|
Hi,
I have a page where I show the result of a query. I only show a few fields but I provide a link besides each record and if a user clicks one of these, a pop up appears. I want to show more database info inside this pop up, like a photo, department, etc... but how? I've thought about writing the javascript function from ASP. Is there are better way?
Thanks, Paco
Edited by - paco on 12 April 2001 11:29:41
Edited by - paco on 12 April 2001 11:30:35 |
|
paco
Junior Member
Spain
187 Posts |
Posted - 12 April 2001 : 11:38:05
|
What about putting a unique field value on a Session variable and, from that, open another recorset on the pop up, search for the record where the unique field matches the one we have and get the desired info?
I think this doesn't look bad , but, is there an easier way?
Thanks, Paco
|
|
|
paco
Junior Member
Spain
187 Posts |
Posted - 12 April 2001 : 12:15:45
|
I've tried the aproach on my last message but I can only store data from the last recordset.
Is there a way to conditionally execute asp code inside javascript?
In other words. How can I put Session("userid")=RS.Field("userid") inside the onClick of a hyperlink and make execute ONLY when the hiperlink is clicked?
Thanks, Paco
Edited by - paco on 12 April 2001 12:16:44 |
|
|
Rigger82
Junior Member
USA
311 Posts |
Posted - 12 April 2001 : 12:43:02
|
I might be confused but if I read this correctly why not have a link on the page with the partial information that has a querystring (moreinfo.asp?id=1), then just read the querystring in the moreinfo.asp popup and load that particular article from the db.
??
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net |
|
|
paco
Junior Member
Spain
187 Posts |
Posted - 17 April 2001 : 04:27:13
|
Mark,
quote:
I might be confused but if I read this correctly why not have a link on the page with the partial information that has a querystring (moreinfo.asp?id=1), then just read the querystring in the moreinfo.asp popup and load that particular article from the db.
??
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net
My problem arouses when I try to get the id value. See, I build the table where I show data like this:
with all rows returned by query ... <td> <a id="<%=RecordSet.Fields("userid") %>" href="popup.asp?id"> + </a> </td> <td > <%response.write .Fields("Name") %> </td> .More fields ... end with
Of course, href="popup.asp?id" does not work as I want the value of id (not the word "id") and I don't know how to get it Help, please.
I think it doesn't matter if I have to pass the id value via link (popup.asp?idvalue) or via Session variable. Maybe it's easier doing it one way than doing it the other way.
Thanks,
Paco
|
|
|
paco
Junior Member
Spain
187 Posts |
Posted - 17 April 2001 : 06:46:39
|
What about using RecordSet.GetRows?
I can't make it work but theorically it can be done.
Still strugling, Paco
|
|
|
big9erfan
Average Member
540 Posts |
Posted - 17 April 2001 : 10:37:32
|
You want it to look something like this
<%Response.Write "<a href='popup.asp?id=' & RecordSet.Fields("userid") & "></a>"%>
Then in your pop up do a id = Request.QueryString("id") and that will retreive the # of the ID from the URL
http://www.ugfl.net/forums |
|
|
paco
Junior Member
Spain
187 Posts |
Posted - 18 April 2001 : 03:22:05
|
Big9erfan,
Thanks. You are right, I want something like that. Actually I got to something similar yesterday but couldn't write to the forums. Now I'm using Recorset.GetRows (see code below). Is there any way to hide the querystring? I imagine the best way is to use a Session variable, but how?
Passing only the id wouldn't be that bad but I'm learning ASP and I'm really curious about other ways of doing this. ... for i=0 to numrows %>
<tr> <td valign="middle" align="center" width="15" bgcolor="#CCCCCC" > <font face="Arial" size="1"> <% cadena="" for h = 0 to ubound (returnedrows,1) cadena = cadena & vreturnedrows(h,i) & "," next mylink = "popup.asp?" & cadena %> <a href="<%=mylink%>" title="See more info" onmouseout="hidetip()" onmouseover="showtip(this,event,'See more info')"> + </a> </font> </td> ...
Thanks, Paco
|
|
|
|
Topic |
|