Last post Mar 07, 2011 08:41 PM by whighfield
Mar 06, 2011 12:08 PM|JoeyNguyen|LINK
Hi I had a Handler to display User's Image by UserId. it worked when I debug in Microsoft Visual Studio 2010, But when I published to the web server the Image did not display. I also used Microsoft Visual Studio 2010 to debug from the the Directory on the
web server, it worked too. But when I tried it through browser it doesn't work.
Here is the Handler:
the code bihind
Mar 06, 2011 01:42 PM|whighfield|LINK
First you have the ContentType wrong in your code:
context.Response.ContentType = "image/mp3"
context.Response.ContentType = "image/jpg"
What happens if you call the Image Handler directly in the Browsers Address bar like so http://YOUR_DOMAIN.COM/DisplayImage.ashx?UserId=XX where XX is a user ID, what happens then?
Mar 07, 2011 09:45 AM|Scott.UD|LINK
Sorry, I cant help with the fix however I am working to solve the exact same problem. It works great on my local machine but not when deployed. I do not have Visual studio 2010 on the web server. Handler.ashx?id=000130787.
I can change my code to call HandlerAnythingHere.ashx?id=AnyNumberHere
and it makes no difference. The properties of the space where the image should go now displays
Handler1234.ashx?id=12345678. My point is I get the same result (place holder only for the image) whether I am calling what I believe to be an existing handler or whether it
calls a handler that is known not to exist.
I am not making an attempt to hijack YOUR issue. Maybe you can verify if the scenerio mentioned above happens for you also.
Mar 07, 2011 09:54 AM|Scott.UD|LINK
When I run the handler directly from the browser address bar I get
Mar 07, 2011 08:41 PM|whighfield|LINK