Dynamic ASPX Image Output for static ...xxx.jpg URL

  • Thread starter Thread starter Alex Maghen
  • Start date Start date
A

Alex Maghen

I have a URL static URL that's being hit all the time:
"http://xyz.com/image.jpg". I want instead to put an ASPX file in that will
either output a dynamic JPEG itself or at least do a redirect to the JPEG I
want.

How can I create a configuration that will "replace"
"http://xyz.com/image.jpg" with an ASPX? And I want to do this somehow INSIDE
the VS.NET Web Project and not in an IIS config because I want it to actually
work when I debug it through the VS IDE.

Thanks for your help.

Alex
 
I have a URL static URL that's being hit all the time:
"http://xyz.com/image.jpg". I want instead to put an ASPX file in that will
either output a dynamic JPEG itself or at least do a redirect to the JPEGI
want.

How can I create a configuration that will "replace"
"http://xyz.com/image.jpg" with an ASPX? And I want to do this somehow INSIDE
the VS.NET Web Project and not in an IIS config because I want it to actually
work when I debug it through the VS IDE.

Thanks for your help.

Alex
You can use HttpHandler this might help:
http://www.hanselman.com/blog/ASPNETFuturesGeneratingDynamicImagesWithHttpHandlersGetsEasier.aspx
 
I have a URL static URL that's being hit all the time:
"http://xyz.com/image.jpg". I want instead to put an ASPX file in that
will
either output a dynamic JPEG itself or at least do a redirect to the
JPEG I
want.

How can I create a configuration that will "replace"
"http://xyz.com/image.jpg" with an ASPX? And I want to do this somehow
INSIDE
the VS.NET Web Project and not in an IIS config because I want it to
actually
work when I debug it through the VS IDE.

Thanks for your help.

Alex

You can insert
<img src="YourASPXPageReturningJpeg.aspx?parametersIfYouLike"/>
 
Dnia 21-06-2010 o 15:25:26 Russell said:
I have a URL static URL that's being hit all the time:
"http://xyz.com/image.jpg". I want instead to put an ASPX file in that
will
either output a dynamic JPEG itself or at least do a redirect to the
JPEG I
want.

How can I create a configuration that will "replace"
"http://xyz.com/image.jpg" with an ASPX? And I want to do this somehow
INSIDE
the VS.NET Web Project and not in an IIS config because I want it to
actually
work when I debug it through the VS IDE.

Thanks for your help.

Alex

This is what ASHX handlers are for. You can map them to paths with an
httpHandler mapping in your web config.

<httpHandlers>
<add verb="*" path="[whatever]" validate="true"
type="[class,assembly]"/>
</httpHandlers>

Yes You are right. Ashx handlers are better because they don't have
unnecessary page life cycle.
 
Back
Top