Forums
This topic is locked
passing dynamic content to a popup window
Posted 19 Dec 2002 21:32:23
1
has voted
19 Dec 2002 21:32:23 Mike Glavin posted:
i have a repeat region that when the image is clicked will lead to a detail.asp page. I need it to open in a popup, say, 600px x 500px. My code is below. Whenever I try to open a new window or make a script for this it either doesn't open as a popup, or the popup holds the default value (the first record) instead of receiving the details that it should. I'm sure that someone out there can help with this. Thank you in advance for any advice.<A HREF="detail.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "ID=" & Recordset2.Fields.Item("ID".Value %>"><img src="<%=(Recordset2.Fields.Item("empty_small".Value)%>" alt="<%=(Recordset2.Fields.Item("Subject".Value)%>" border="0"></A>
Replies
Replied 20 Dec 2002 09:16:49
20 Dec 2002 09:16:49 Vince Baker replied:
The easiest way is to use the advanced open window extension.
Search on google and you will find it (not sure if it is this site?)
Makes life easier
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
Search on google and you will find it (not sure if it is this site?)
Makes life easier
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 20 Dec 2002 18:11:04
20 Dec 2002 18:11:04 Dave Blohm replied:
While extensions make it easy to get things done, most people that post questions in here (the .ASP forum) actually want to learn how to do the voodoo that we do.
That being said...
if you set up a string for the variables being passed, you won't get screwed up with having to make sure all the quotation marks are laid out right in the JavaScript string...
so do something like this:
<%
myPath = MM_keepURL & MM_joinChar(MM_keepURL) & "&ID=" & Recordset2.Fields.Item("ID".Value
%>
Then your link will look something like this:
<a href="#" onClick="window.open('detail.asp?<%= myPath %>','mywin','width=600,height=500')"><img src="<%=(Recordset2.Fields.Item("empty_small".Value)%>" alt="<%=(Recordset2.ds.Item("Subject".Value)%>" border="0"></a>
That SHOULD be right...it's the last day before the holiday break and I'm getting lazy so I didn't actually create the recordsets in my test...
Let me know if you need further help on this...
Doc
Rangewalk Digital Studios
Edited by - on 20 Dec 2002 18:11:44
That being said...
if you set up a string for the variables being passed, you won't get screwed up with having to make sure all the quotation marks are laid out right in the JavaScript string...
so do something like this:
<%
myPath = MM_keepURL & MM_joinChar(MM_keepURL) & "&ID=" & Recordset2.Fields.Item("ID".Value
%>
Then your link will look something like this:
<a href="#" onClick="window.open('detail.asp?<%= myPath %>','mywin','width=600,height=500')"><img src="<%=(Recordset2.Fields.Item("empty_small".Value)%>" alt="<%=(Recordset2.ds.Item("Subject".Value)%>" border="0"></a>
That SHOULD be right...it's the last day before the holiday break and I'm getting lazy so I didn't actually create the recordsets in my test...
Let me know if you need further help on this...
Doc
Rangewalk Digital Studios
Edited by - on 20 Dec 2002 18:11:44
Replied 21 Dec 2002 17:56:32
21 Dec 2002 17:56:32 Mike Glavin replied:
Thanks Doc. I too prefer to make it myself - when possible - but I don't have a problem with extensions. I really like how clean your bit of code is, and will likely convert my page over to that format. I managed to get it going myself, using the code below. Enjoy the Holidays. Mike
<a href="javascript:;" onClick="MM_openBrWindow('detail.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "ID=" & Recordset2.Fields.Item("ID".Value %>','detail','','770','400','true')"><img src="<%=(Recordset2.Fields.Item("empty_small".Value)%>" alt="<%=(Recordset2.Fields.Item("Subject".Value)%>" border="0"></a>
<a href="javascript:;" onClick="MM_openBrWindow('detail.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "ID=" & Recordset2.Fields.Item("ID".Value %>','detail','','770','400','true')"><img src="<%=(Recordset2.Fields.Item("empty_small".Value)%>" alt="<%=(Recordset2.Fields.Item("Subject".Value)%>" border="0"></a>