hi,
I have an image added a App_GlobalResources folder. How do i load this image to my image control (dynamically)?
TY
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 26, 2009, 3:42 AM EDT
These folders are protected from HTTP download, because are supposed to be used server side only
For example, the App_GlobalResources folder is used to contain resources
files (.resx) that are automatically compiled into typed classes, that are
accessible from all Pages of your site.
So, you should use another folder to place your images
check "Do you like this answer" if it helped you :)
Venkatesh Ellur30 reputationPosted Oct 26, 2009, 2:30 AM EDT
for example if you want to load the image on click of a button try setting up the property on the button click event.
petre ricardo155 reputationPosted Oct 26, 2009, 2:44 AM EDT
TY
Nilanka DharmadasaRank #1,875 · 794 reputationPosted Oct 26, 2009, 3:54 AM EDT
Here I assume that you have added your image as a resource to the project.
If my answer helps you please accept my answer. :)
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 26, 2009, 4:23 AM EDT
There is no Image Property Available in Image Control of Asp.net you just have one way thats to assign path it will be assigned to image but ImageControl Will not show the image thats in App_GlobalResources
normally App_GlobalResources are used to store Globalization Files ie (Resources for Multilaguale Site ) like en-Us.resx etc ..
:)
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 26, 2009, 11:54 AM EDT
If still you want to learn how to Upload Image to Image Folder and then Show it In Image Control Here is Code for you
protected void btnUpload_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile == true)
{
//Get Just FileName not Full path of File
string FileName = FileUpload1.FileName;
//Get Actual Path of Images Folder on Server
string FolderPathToSave = Server.MapPath("images");
//Save Image in Images Folder
FileUpload1.SaveAs(FolderPathToSave+@"\"+FileName);
string PathToStoreInDatabase = @"~\images\" + FileName;
// Insert PathToStoreDatabase in Database to Retrive Image Path Again When you need From Database
//Like If you want to Show Uploaded Image in Picture Control Then Code below
Image1.ImageUrl = PathToStoreInDatabase;
}
}