Resource Files, Images, And The ImageUrl Property

N

Nathan Sokalski

I have a resource file (*.resx) with several images in it. I am having
trouble finding a way to use these images for controls such as Image,
ImageButton, and other controls that an image can be assigned to. I have no
trouble using String resources, but since the ImageUrl property expects a
String, not an image, I am having trouple here. The only solution I can come
up with is to create an extra Page that takes a querystring and returns an
image, and then use that as the value for the ImageUrl, but it doesn't seem
like that should be necessary. Is there a way to get a string that can be
assigned to the ImageUrl property, or some way to access the images without
saving them as individual files? Thanks.
 
N

Nathan Sokalski

No, that does not help. I am looking for a way to use the image stored in
the *.resx file. I do not want to need to upload the original *.gif or
*.jpeg file, that is why I am putting the image in the *.resx file. The page
you mentioned suggests using a String in the *.resx file, which works if you
upload the original image, but if you are going to do that, you may as well
not even use a *.resx file.
 
A

Allen Chen [MSFT]

Hi Nathan,

As far as I know there's no way to do this. As we know, the ASP.NET Image
control will render <img> to the client side. When the browser sees this
HTML tag it'll try to download the image from the URL specified in the src
attribute of the <img> tag. There's no way for ASP.NET to render images
directly to the client side along with other HTML tags in one
request-response.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Nathan Sokalski" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Resource Files, Images, And The ImageUrl Property
| Date: Sun, 14 Sep 2008 16:15:23 -0400
| Lines: 29
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
| Message-ID: <#[email protected]>
| Newsgroups:
microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.aspnet,m
icrosoft.public.dotnet.framework.aspnet.buildingcontrols,microsoft.public.do
tnet.languages.csharp,microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: pool-72-81-61-33.phlapa.east.verizon.net 72.81.61.33
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP04.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:75986
microsoft.public.dotnet.framework.aspnet.buildingcontrols:1115
microsoft.public.dotnet.languages.csharp:104698
microsoft.public.dotnet.languages.vb:50978
microsoft.public.dotnet.framework:16162
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
|
| No, that does not help. I am looking for a way to use the image stored in
| the *.resx file. I do not want to need to upload the original *.gif or
| *.jpeg file, that is why I am putting the image in the *.resx file. The
page
| you mentioned suggests using a String in the *.resx file, which works if
you
| upload the original image, but if you are going to do that, you may as
well
| not even use a *.resx file.
| --
| Nathan Sokalski
| (e-mail address removed)
| http://www.nathansokalski.com/
|
| | > Hi
| >
| > check out this thread..
| > might help you
| > http://forums.asp.net/p/1299694/2534052.aspx
| >
| > Regards
| >
| > -------
| > Munna
| >
| > www.munna.shatkotha.com/blog
| > www.munna.shatkotha.com
| > www.shatkotha.com
|
|
|
 

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

No members online now.

Forum statistics

Threads
474,056
Messages
2,570,443
Members
47,089
Latest member
Bobby2025b

Latest Threads

Top