Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

popup for thumbnails from querystring

Status
Not open for further replies.

gemoon

Programmer
Mar 22, 2002
55
US
i am very new to asp, so forgive me if the answer to this question is obvious.

i have an asp page that queries an access database. the page has thumbnail images. i want the user to be able to click the thumbnails on the page and have a popup of a larger image appear. not all thumbnails have images so ive used if then else statements.

im not sure what im doing wrong. any advice would be greatly appreciated.

<script>
function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);
}
</script>

If
rsReadDetail("lgImage") = "" or IsEmpty(rsReadDetail("lgImage")) or IsNull(rsReadDetail("lgImage"))

then
Response.Write ("<img src='images/")
Response.Write (rsReadDetail("Image"))
Response.Write ("' border='0' align='absbottom'>")

Else
' if lgImage, write hyperlink to it.
Response.Write ("<a href='#' onClick='MM_openBrWindow('images/")
Response.Write (rsReadDetail("lgImage"))
Response.Write("','','scrollbars=yes,resizable=yes,width=200,height=300')'>")
Response.Write ("<img src='images/")
Response.Write (rsReadDetail("Image"))
Response.Write ("' border='0' align='absbottom'>")
Response.Write ("</a>")
End If
 
Ok, my knowledge of DMTML sucks and Java event worse.

HOWEVER.... to trouble shoot this one, you just need to ask yourself (or the asp page) 2 things.

1. What is is supposed to look like (the rendered html)
2. What does it look like.(the rendered html)

or maybe
is there an error being reutrned when you try to browse the page?

HTH


Rob
 
I have tested the following and it works:

<a href="#" onClick="MM_openBrWindow('images/lgImage,'','width=400,height=500')"><img src="images/Image" alt="alt text" width="250" height="203" border="0"></a>

But becuase i dont know how to write a double quotes, I am writting the rendered html as:

<a href='#' onClick='MM_openBrWindow('images/lgImage,'','width=400,height=500')'><img src="images/Image" alt="alt text" width="250" height="203" border="0">

The problem is definitely with the missing double quote marks around the # and the MM_openBrWindow. How do I write a double quote ( " ) using response.write?

Thanks for the help.
Ed.
 
AHh.. the trick is that one double quote should escape another..

i.e. to get a double quote to be Literal use 2
response.write "this is a sample of ""double qoutes"" in action"

should return

this is a sample of "double qoutes" in action

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top