physical path vs virtual path

2 posts, 0 answers
  1. doug
    doug avatar
    25 posts
    Member since:
    Jan 2011

    Posted 17 Mar 2015 Link to this post

    I'm trying to display images from another server path using ImageGallery example below: (actually code with read from database loop)  anyway, if I put the images in the wwwroot folder path it works "~\images\" but when I point to a physical path it doesn't.

    Protected Sub RadImageGallery1_NeedDataSource(sender As Object, e As Telerik.Web.UI.ImageGalleryNeedDataSourceEventArgs) Handles RadImageGallery1.NeedDataSource
    TryCast(sender, RadImageGallery).DataSource = GetImageGalleryData()
    End Sub

    Private Function GetImageGalleryData() As DataTable
    Dim table As New DataTable()
    table.Columns.Add("Title", GetType(String))
    table.Columns.Add("Description", GetType(String))
    table.Columns.Add("ImageData", GetType(String))

    table.Rows.Add("Image 1", "Description", "c:\images\Bale-0301201638060.jpg")
    table.Rows.Add("Image 2", "Description", "c:\images\Bale-0301201638060.jpg")

    Return table
    End Function

  2. Konstantin Dikov
    Konstantin Dikov avatar
    2409 posts

    Posted 20 Mar 2015 Link to this post

    Hi Doug,

    The physical path is related to the local machine of the user, so I am not sure why you would need such functionality in the first place.

    If your images are outside your root directory, you need to set the full URL to the images (like http://myimageserver/image1.jpg for example).

    As for the physical path, you could also take a look at the following forum post:
    Hope this helps.

    Konstantin Dikov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top