I am trying to implement a HttpHandler in order to retrieve an image from a database. I have two problems:
1) The line
imageID = context.Request.QueryString("ImageID")
is not retrieving the query string from aspx page where I have an img tag such as
<img
src="PersonMain.aspx?ImageID=198274"/>
2) If I hard code the imageID instead of retrieving it from the query string I can get it to display the image, however, NONE of the other content on the page is displaying. I assume this has something to do with the HttpHandler, however,
my knowledge in this area is limited.
None
0 Points
11 Posts
HttpHandler - image retrieval from database - content on page disappearing after implementation
Aug 10, 2005 12:04 AM|lance487|LINK
1) The line
imageID = context.Request.QueryString("ImageID")
is not retrieving the query string from aspx page where I have an img tag such as <img src="PersonMain.aspx?ImageID=198274"/>
2) If I hard code the imageID instead of retrieving it from the query string I can get it to display the image, however, NONE of the other content on the page is displaying. I assume this has something to do with the HttpHandler, however, my knowledge in this area is limited.
Any help is always greatly appreciated.
Regards,
Lance
Member
132 Points
670 Posts
Re: HttpHandler - image retrieval from database - content on page disappearing after implementati...
Aug 10, 2005 12:07 PM|billrob458|LINK
Post your <httpHandlers> section of your web.config file. I am thinking it is wired up incorrectly. Also post your definition of your httphandler. ie:
namespace WebApp1
{
public class ImageHandler : IHttpHandler
}
bill
None
0 Points
11 Posts
Re: HttpHandler - image retrieval from database - content on page disappearing after implementati...
Aug 14, 2005 07:16 PM|lance487|LINK
http://student.cqu.edu.au/~s0012134/ImageTest.zip is a zip file containing all relevant information, thanks for your time :)
Lance
Member
132 Points
670 Posts
Re: HttpHandler - image retrieval from database - content on page disappearing after implementati...
Aug 15, 2005 12:05 PM|billrob458|LINK
In your web.config try changing
<add verb="*" path="ImageTest.aspx" type="Feral.ImageHandlerVB"/>
to
<add verb="*" path="ImageTest.axd" type="Feral.ImageHandlerVB"/>
And in your ImageTest.aspx, you can change your link from
<img src="ImageTest.aspx?ImageID=198274"/>
to
<img src="ImageTest.axd?ImageID=198274"/>
Let me know how this turns out for you.
bill