Solved

How to display image in image control from folder located outside of application

Posted on 2013-06-27
1
439 Views
Last Modified: 2013-07-09
I have a project using ASP.net and Visual Studio. I want to display an image using image control. However the image(s) are outside of the visual studio project. I have setup a virtual directory and used that as my image1.imageurl property. It worked the first time I tried it but I deleted the original.aspx I created and started a fresh one and now it doesn't work.

virtual directory  Alias = collateral
I enabled browsing on the virtual directory

ASP.net page with image control.
image1.Imageurl = collateral/penguins.jpg
penguins.jpg is there
I have also tried /collateral/penguins.jpg as well but no luck.

Any help or alternatives would be appreciated.
0
Comment
Question by:laskydiver
1 Comment
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 39285404
Does this work - this assumes the current directory contains the other directory and image
image1.Imageurl = ./collateral/penguins.jpg


(If it doesn't then you may want to display a message box or similar with the current path - maybe it isn't what you assume it is).
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now