How to work with images in resources

W

WT

Hi,
Documpentation for VS 2005 is not clear about how to put a gif image in
resources and how to get it from an <asp:image .../> or <img /> web control.

It seems that IE send some .axd process to get images or .js scripts from
resources for MS controls, how to do this.

Thanks
CS
 
E

Edwin Knoppert

loading images is an asynchronious matter.
And thus not sequential.
If you want to use resources you might consider to use a generic handler and
stream the image to the user.
It's very easy..

I discourage you to do this, maintenance of your project will be worse, if
you need to upload the darn thing each time.

But as learning thing, or for dynaminc image loading you might consider the
..ashx stuff.
:)
 
W

WT

Thanks, but its done by asp.net 2 ???

Edwin Knoppert said:
loading images is an asynchronious matter.
And thus not sequential.
If you want to use resources you might consider to use a generic handler
and stream the image to the user.
It's very easy..

I discourage you to do this, maintenance of your project will be worse, if
you need to upload the darn thing each time.

But as learning thing, or for dynaminc image loading you might consider
the .ashx stuff.
:)
 
E

Edwin Knoppert

Of course, you can do about anything with asp.net

A generic page is an .ashx file.
the image src should point to that.
I can recommend you to use paramters for image indexes like:
....myimagehandler.ashx?img=1

In the handler use a switch() and do a
response.write...(resources.resource.imagename...)
The contenttype must be set as well like image/jpeg ( i forgot but you know
what i mean)
I don't think you have to do anything else.

It's really not dificult, try it out..
 
W

Walter Wang [MSFT]

Hi CS,

Thank you for posting!

From your description, I assume you are talking about one of ASP.NET 2.0
new features: Web Resources. At a highlevel it provides a nice way for
control developers to encapsulate resources for their controls within a
compiled assembly (as resources), and then be able to leverage them at both
runtime and design-time without having to copy files all over their dev
machine and web-server (for example: for images, scripts, etc).

WebResource.axd is a new Handler we are shipping to allow control and page
developers to download resources that are embedded in an assembly.

For more information on how to work with Web Resources in ASP.NET 2.0:
http://support.microsoft.com/kb/910442/

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top