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

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
 
B

behdad

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 use HttpHandler this might help:
http://www.hanselman.com/blog/ASPNETFuturesGeneratingDynamicImagesWithHttpHandlersGetsEasier.aspx
 
3

3P

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"/>
 
3

3P

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top