Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6962207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:37:47+00:00 2026-05-27T15:37:47+00:00

I have a rather simple task, retrieving an image file from a virtual folder

  • 0

I have a rather simple task, retrieving an image file from a virtual folder outside of my ASP.Net web Application (The Virtual Folder is in the root of the website) and then displaying it in an image control. I am able to to access a Virtual Folder that is within the web site. Here is my code that

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim sourcefile As String = Server.MapPath("~/Common/Images/LAPDPatch.jpg")
    Image1.ImageUrl = sourcefile
End Sub

What am I doing wrong?

Ok, I was able to figure it out:

Solution

Ok, I was able to get it working, I was using the wrong “slash” character I was using the forward slash instead of the back slash:

Dim sourcefile As String = Server.MapPath("\VitualFolderName\") & "Images\LAPDPatch.jpg"

Thanks to all who responded!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:37:47+00:00Added an answer on May 27, 2026 at 3:37 pm

    UseResolveUrl:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'root of currently running app, virtual or not
        Dim sourcefile As String = Page.ResolveUrl("~/Common/Images/LAPDPatch.jpg")
    
        'root of site
        'Dim sourcefile As String = "/Common/Images/LAPDPatch.jpg"
    
        'root of another site
        'Dim sourcefile As String = "/VirtualDir/Common/Images/LAPDPatch.jpg"
    
        Image1.ImageUrl = sourcefile
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a timesheet application in Asp.Net MVC, but the question should be general
We have a rather simple site (minimal JS) with plain html and CSS. It
I will try to keep this as simple as possible. I have a rather
Heavy emphasis on simple. I've never made an installer and I'd rather not have
I'm rather new to WPF, so maybe this is a simple question. I have
I have a rather large file (150 million lines of 10 chars). I need
I have a simple web service sitting on our internal network. I used SOAPUI
I have the unfortunate task of having to import data from excel into a
I have a C# WPF application using a rather noddy MVVM approach. In one
SQL 2008 Hello, I have a rather different task I have to do in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.