Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2006, 07:43 PM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Resource files and images/icons/ not strings!

Greetings everyone,

I've started a mission on learning to use resource files with my web applications. I'm starting simple just learning how to put assets in to my resource files, and then reference to them within my content pages and code-behind pages.

I'm able to handle string resources no problem. I've moved on to trying to add/retrieve images. Here's where I'm getting stuck! (So I can only imagine where I'll be trying to skip images and checking out icons or media or files or... or.. or... you get the picture)

I have my default.aspx page (with her .cs file as well) and I've created the Default.aspx.resx file stored in the App_LocalResources folder. I've added a test image with the name "defaultImg" filename of "userDefaultImg.gif" it tells me the Type is "Graphics Interchange Format" with size of "140x140".

Now... How the heck do I display this image resource on my default.aspx page?

I know when I add a string resource, I can easily set the text of, say, a label control by:

<asp:label id="lblSample" runat="server" Text="<%$ Resources:MSG_GREETINGS %>">

But Resources:defaultImg will give me "System.Drawing.Bitmap" if I try and set the same way:

<asp:Image ID="imgTest" runat="server" ImageUrl="<%$ Resources:defaultImg %>" />

What's the best way to retrieve these image assets I've placed in to my resource files?


PS. yes, I'm still very new to developing in .NET. ^^ So please be gentle. ^^

this is my signature





Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating Excel FIles from resource Files abinashpatra ASP.NET 1.0 and 1.1 Basics 0 July 28th, 2008 02:07 AM
Problem with Resource Files dparsons VS.NET 2002/2003 3 May 8th, 2007 02:00 PM
Application Preferences And Resource Files geomar General .NET 0 November 14th, 2006 01:35 PM
Using Resource files for different Languages Bexm BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 January 23rd, 2006 08:12 AM
Resource files dotnetprogrammer VS.NET 2002/2003 0 December 20th, 2004 08:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.