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. (SOLVED) WHy is my image not displaying on a certain page?

(SOLVED) WHy is my image not displaying on a certain page?

Scheduled Pinned Locked Moved ASP.NET
dockerhelpquestion
5 Posts 2 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.
  • S Offline
    S Offline
    samflex
    wrote on last edited by
    #1

    Can someone please help me understand why images is not displaying on this page? I have a calendar that displays various events with appropriate pictures. On the calendar itself, a small image is displayed (this works fine). Here is the code for that:

                    [','EventsDetail','width=800,height=600;toolbar=no;');" & ">                    
                        ![](images/<%# Container.DataItem("CategoryImage") %>)  
                        <%# Container.DataItem("EventTitle") %>
                        
                    ](#)
    

    en you on any given date, you are taken to the details page of that part event. This is where a larger image is supposed to be displayed. However, the image is not displaying. It is not even showing the little icon when picture is not present. What am I doing wrong? Here is that code for the eventDetails page. Thanks in advance for your assistance. //VB

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    If Not IsPostBack Then
    If (Not (Request.QueryString("id")) Is Nothing) Then
    Session("apomember") = Request.QueryString("id")
    End If
    BindGrid()
    End If

    Richard DeemingR 1 Reply Last reply
    0
    • S samflex

      Can someone please help me understand why images is not displaying on this page? I have a calendar that displays various events with appropriate pictures. On the calendar itself, a small image is displayed (this works fine). Here is the code for that:

                      [','EventsDetail','width=800,height=600;toolbar=no;');" & ">                    
                          ![](images/<%# Container.DataItem("CategoryImage") %>)  
                          <%# Container.DataItem("EventTitle") %>
                          
                      ](#)
      

      en you on any given date, you are taken to the details page of that part event. This is where a larger image is supposed to be displayed. However, the image is not displaying. It is not even showing the little icon when picture is not present. What am I doing wrong? Here is that code for the eventDetails page. Thanks in advance for your assistance. //VB

      Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
      If Not IsPostBack Then
      If (Not (Request.QueryString("id")) Is Nothing) Then
      Session("apomember") = Request.QueryString("id")
      End If
      BindGrid()
      End If

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      samflex wrote:

      <asp:Image ID="Image1" ImageUrl='/admin/memberPhotos/ & <%# Eval("CategoryImage") %>' runat="server" Height="100" Width="100" />

      You can't mix static and data-bound content in a server property like that. Try:

      <asp:Image ID="Image1" ImageUrl='<%# Eval("CategoryImage", "/admin/memberPhotos/{0}") %>' runat="server" Height="100" Width="100" />


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      S 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        samflex wrote:

        <asp:Image ID="Image1" ImageUrl='/admin/memberPhotos/ & <%# Eval("CategoryImage") %>' runat="server" Height="100" Width="100" />

        You can't mix static and data-bound content in a server property like that. Try:

        <asp:Image ID="Image1" ImageUrl='<%# Eval("CategoryImage", "/admin/memberPhotos/{0}") %>' runat="server" Height="100" Width="100" />


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

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

        Hi Richard, That didn't work. It still displays blank image but this *seems* to have worked:

        age1.ImageUrl = "~/images/" & dr("CategoryImage").ToString()

        Thanks for your help as always sir.

        Richard DeemingR 1 Reply Last reply
        0
        • S samflex

          Hi Richard, That didn't work. It still displays blank image but this *seems* to have worked:

          age1.ImageUrl = "~/images/" & dr("CategoryImage").ToString()

          Thanks for your help as always sir.

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          The one that didn't work is pointing to: /admin/memberPhotos/{image} The one that did work is pointing to: ~/images/{image} So the markup would need to look something like:

          <asp:Image ID="Image1" ImageUrl='<%# Eval("CategoryImage", "~/images/{0}") %>' runat="server" Height="100" Width="100" />


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          S 1 Reply Last reply
          0
          • Richard DeemingR Richard Deeming

            The one that didn't work is pointing to: /admin/memberPhotos/{image} The one that did work is pointing to: ~/images/{image} So the markup would need to look something like:

            <asp:Image ID="Image1" ImageUrl='<%# Eval("CategoryImage", "~/images/{0}") %>' runat="server" Height="100" Width="100" />


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            S Offline
            S Offline
            samflex
            wrote on last edited by
            #5

            No sir, I have the image on both folders. I was not intending to have them on both folders but I just wanted to see if any of those would work.

            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