Resource files and images/icons/anything other than strings!

    Date: 04/11/06 (Asp Dot Net)    Keywords: asp, web

    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:



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



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

    Source: http://community.livejournal.com/aspdotnet/61620.html

« New VS.Net file extensions || asp.net 2.0 »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home