Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Showing more database info on pop-up, how?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

paco
Junior Member

Spain
187 Posts

Posted - 12 April 2001 :  11:25:39  Show Profile
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  Show Profile
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

Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 12 April 2001 :  12:15:45  Show Profile
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
Go to Top of Page

Rigger82
Junior Member

USA
311 Posts

Posted - 12 April 2001 :  12:43:02  Show Profile  Visit Rigger82's Homepage  Send Rigger82 an AOL message  Send Rigger82 a Yahoo! Message
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
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 17 April 2001 :  04:27:13  Show Profile
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

Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 17 April 2001 :  06:46:39  Show Profile
What about using RecordSet.GetRows?

I can't make it work but theorically it can be done.

Still strugling,
Paco


Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 17 April 2001 :  10:37:32  Show Profile
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
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 18 April 2001 :  03:22:05  Show Profile
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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.36 seconds. Powered By: Snitz Forums 2000 Version 3.4.07