Display javascript close button on pop up RRS feed

  • Question

  • User1829208979 posted
    Hi I have a web app, in which I have to display pics in a pop up window when a user clicks on a link. However the pics are in a folder that has a redirection URL set to it. This is done to prevent users from seeing the pictures in the directory. I am using the following code to get pictures from the dir onto the pop up window. But I am not able to 1) get a javascript "Close window" link to show beneath the pic and 2) change the url to the pic that appears as the title of the pop up window. ' Initialize objects Dim objImage, objThumbnail As System.Drawing.Image Dim strServerPath, strFilename As String Dim shtWidth, shtHeight As Short strServerPath = Server.MapPath("Photos") ' Retrieve name of file to resize from query string strFilename = strServerPath & Request.QueryString("URLPath") ' Retrieve file, or error.gif if not available Try objImage = objImage.FromFile(strFilename) Catch objImage = objImage.FromFile(strServerPath & "\nophoto\nopic.jpg") End Try ' Send down to client Response.ContentType = "image/jpeg" objImage.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg) ' Tidy up objImage.Dispose() Any help would be greatly appreciated. Thanks Sona
    Sunday, October 31, 2004 5:15 PM

All replies

  • User-1091152964 posted
    The way you are doing it, it is not possible to do this ... You can keep this page however, but, set a aspx page before it. What I mean is that you create a aspx page with a picture on it (choose anything) and all the buttons you need now change the url of the picture to something like this: GetPicture.aspx?ID=xx You can dynamically replace the xx with the coreect number and you can also set the page title ... You get the image in two steps ... :-))
    Monday, November 1, 2004 2:46 AM
  • User1829208979 posted
    Hi Thanks for the help. I followed your advice and its now working as I wanted. The only problem I have is wiht big images. I have pre set the size of the pop up window. If the image is larger it doesnt scale like it did when I was using the earlier method. I guess it s because the image control expands to the entire size of the image. Is there a way I could scale down the larger images. Thanks Sona
    Tuesday, November 2, 2004 12:55 PM