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. Image not display

Image not display

Scheduled Pinned Locked Moved ASP.NET
sysadmin
6 Posts 5 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.
  • L Offline
    L Offline
    lrsalunkhe
    wrote on last edited by
    #1

    Respected, Hi sir ,I am save the image on server folder when I retrieve image for display from server folder it not be display my code is as follow : Dim photo As String = "JC001924.jpg" Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo Image1.ImageUrl = Server.MapPath(strimage)

    B S D J 4 Replies Last reply
    0
    • L lrsalunkhe

      Respected, Hi sir ,I am save the image on server folder when I retrieve image for display from server folder it not be display my code is as follow : Dim photo As String = "JC001924.jpg" Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo Image1.ImageUrl = Server.MapPath(strimage)

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      Your variable strimage returns correct path?! It seems to me that isn't correctly initialized.


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com

      L 1 Reply Last reply
      0
      • L lrsalunkhe

        Respected, Hi sir ,I am save the image on server folder when I retrieve image for display from server folder it not be display my code is as follow : Dim photo As String = "JC001924.jpg" Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo Image1.ImageUrl = Server.MapPath(strimage)

        S Offline
        S Offline
        sashidhar
        wrote on last edited by
        #3

        whats this..? Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo the easy way to find the path is to ..! drop an image control and go to properties set the image url to the image which is stored in the folder..!and copy the path from the source which will generate by VS..!

        LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

        1 Reply Last reply
        0
        • L lrsalunkhe

          Respected, Hi sir ,I am save the image on server folder when I retrieve image for display from server folder it not be display my code is as follow : Dim photo As String = "JC001924.jpg" Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo Image1.ImageUrl = Server.MapPath(strimage)

          D Offline
          D Offline
          DoctorMick
          wrote on last edited by
          #4

          I might be missing something blindingly obvious here but you don't need to call Server.MapPath when setting an image url. Server.MapPath will give you the physical location on the server disk which is useless when the web page is sent to the client.

          1 Reply Last reply
          0
          • L lrsalunkhe

            Respected, Hi sir ,I am save the image on server folder when I retrieve image for display from server folder it not be display my code is as follow : Dim photo As String = "JC001924.jpg" Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo Image1.ImageUrl = Server.MapPath(strimage)

            J Offline
            J Offline
            J a a n s
            wrote on last edited by
            #5

            Server.MapPath will return the actual physical path which wont work as an image url. If you want to generate the virtual path at run time use Page.ResolveClientUrl method instead.

            "Never put off until run time what you can do at compile time." - David Gries, in "Compiler Construction for Digital Computers", circa 1969.

            1 Reply Last reply
            0
            • B Blue_Boy

              Your variable strimage returns correct path?! It seems to me that isn't correctly initialized.


              I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com

              L Offline
              L Offline
              lrsalunkhe
              wrote on last edited by
              #6

              Thanks

              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