Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Loading image into WebPage...

Loading image into WebPage...

Scheduled Pinned Locked Moved ASP.NET
sysadminhelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anil Kumar Arvapalli
    wrote on last edited by
    #1

    <asp:Image ID="Image1" runat="server" Height="416px" ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG" Width="846px" /> When iam loading image from other than current directory the image is not loading ... / If i copy the same photos into current directory it is loading ... What is going beyond it , why the problem exists.....

    A M 2 Replies Last reply
    0
    • A Anil Kumar Arvapalli

      <asp:Image ID="Image1" runat="server" Height="416px" ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG" Width="846px" /> When iam loading image from other than current directory the image is not loading ... / If i copy the same photos into current directory it is loading ... What is going beyond it , why the problem exists.....

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      Pardhu2 wrote:

      ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG"

      What are you doing.... Always use relative path to the server. Means if the pictures is in folder a under your root directory xx then you should write : ImageUrl = "~xx/a/DSC08182.JPG" Always remember, ImageUrl will be transmitted to the html sent to the client as response. Now from browser of the client it cant point to E:/College Photos/Farewell Party/DSC08182.JPG as it would mean its own computer. The browser should request url using http://www.yourserver.com/xx/a/DSC08182.JPG Hope you got it. :-D :thumbsup:

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Simplify Code Using NDepend
      Basics of Bing Search API using .NET
      Microsoft Bing MAP using Javascript

      A 1 Reply Last reply
      0
      • A Abhishek Sur

        Pardhu2 wrote:

        ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG"

        What are you doing.... Always use relative path to the server. Means if the pictures is in folder a under your root directory xx then you should write : ImageUrl = "~xx/a/DSC08182.JPG" Always remember, ImageUrl will be transmitted to the html sent to the client as response. Now from browser of the client it cant point to E:/College Photos/Farewell Party/DSC08182.JPG as it would mean its own computer. The browser should request url using http://www.yourserver.com/xx/a/DSC08182.JPG Hope you got it. :-D :thumbsup:

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        A Offline
        A Offline
        Anil Kumar Arvapalli
        wrote on last edited by
        #3

        thnku i got it .... but how to point the url to local host (e://.....) which u mentioned in last case...... http://www.yourserver.com/xx/a/DSC08182.JPG[^]

        A 1 Reply Last reply
        0
        • A Anil Kumar Arvapalli

          thnku i got it .... but how to point the url to local host (e://.....) which u mentioned in last case...... http://www.yourserver.com/xx/a/DSC08182.JPG[^]

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          Just use relative path as I mentioned. ~/xx/a/DSC08182.JPG will automatically point to http://localhost/xx/aa/DSC08182.JPG if you are running from localhost. ;) Cheers.

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Simplify Code Using NDepend
          Basics of Bing Search API using .NET
          Microsoft Bing MAP using Javascript

          1 Reply Last reply
          0
          • A Anil Kumar Arvapalli

            <asp:Image ID="Image1" runat="server" Height="416px" ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG" Width="846px" /> When iam loading image from other than current directory the image is not loading ... / If i copy the same photos into current directory it is loading ... What is going beyond it , why the problem exists.....

            M Offline
            M Offline
            Mark Graham
            wrote on last edited by
            #5

            It's also worth pointing out that if you decide to use plain old html instead of an asp:Image then you should drop the tilde(~) Mark Graham (MCP) blogging about Design Patterns, C#, Asp.Net, CSS, Javascript and Ajax at: DESIGN CODE TEST[^]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups