(SOLVED) WHy is my image not displaying on a certain page?
-
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;');" & ">  %>) <%# 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 -
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;');" & ">  %>) <%# 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 Ifsamflex 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
-
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
-
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.
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
-
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