Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

WHy is my image not displaying on a certain page?

$
0
0
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:

<body><form id="Form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server" /><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><dc:DataCalendar id="cal1" runat="server"
                             DayField="EventDate" OnVisibleMonthChanged="MonthChange"
                Height="295px" Width="275px" BorderColor="#EFEFDE"
                DayNameFormat="Shortest" SelectedDate="2012-11-17"><DayStyle HorizontalAlign="Left" VerticalAlign="Top"
                          Font-Size="7" Font-Names="Arial" BackColor="white" /><OtherMonthDayStyle BackColor="white" ForeColor="white" /><ItemTemplate><a href='#' OnClick="javascript:window.open('admin/eventDetails.aspx?id=<%# Container.DataItem("EventID") %>','EventsDetail','width=800,height=600;toolbar=no;');"& ">                    <img  alt="" src='images/<%# Container.DataItem("CategoryImage") %>' height="12" width="12" align="absmiddle" border="0" /><br /><font color='<%# Container.DataItem("CategoryColor") %>'><%# Container.DataItem("EventTitle") %></font></a>            </ItemTemplate><TitleStyle BackColor="#CEDFCE" Font-Bold="True" /></dc:DataCalendar></ContentTemplate></asp:UpdatePanel></form></body>


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
    End Sub
    Private Sub BindGrid()
        Dim myConnectionstring As String = ConfigurationManager.ConnectionStrings("test").ConnectionString
        Dim myConn As New SqlConnection(myConnectionstring)
        myConn.Open()
        Dim cmd As New SqlCommand("SELECT e.EventID, e.EventTitle, e.EventDescription, e.EventDate, c.CategoryTitle, c.CategoryImage, c.CategoryColor "&"FROM Events e INNER JOIN Categories c ON e.EventCategory = c.CategoryID where c.CategoryID = @apoid ORDER BY e.EventDate", myConn)
        cmd.Parameters.AddWithValue("@apoid", Session("apomember"))
        Dim dr As SqlDataReader = cmd.ExecuteReader()
        If dr.Read() Then
            txtTitle.Text = dr("EventTitle").ToString()
            txtTitle.Text = dr("EventDate").ToString()
            txtDate.Text = dr("EventDescription").ToString()
            txtDescription.Text = dr("EventTitle").ToString()
            txtCategory.Text = dr("CategoryImage").ToString()
        End If
        myConn.Close()
    End Sub


//Markup

<formid="form1"runat="server"><div><ahref="#"id="logo"><imgsrc="/images/skin1/owerri_logo.jpg"Height="245"Width="322"alt="Owerri Family Union"border="0"title="Owerri Family Union"/></a>           Owerri Family Union, Atlanta, GA - USA</div><hr/><table><trstyle="margin-top:10px;"><td>Event Title:</td><td><asp:Labelid="txtTitle"runat="server"></asp:Label></td></tr><trstyle="margin-top:10px;"><td>Event Date:</td><td><asp:Labelid="txtDate"runat="server"></asp:Label></td></tr><trstyle="margin-top:10px;"><td>Event Description:</td><td><asp:Labelid="txtDescription"runat="server"></asp:Label></td></tr><trstyle="margin-top:10px;"><td>Category:</td><td><asp:ImageID="Image1"ImageUrl='/admin/memberPhotos/ & <%# Eval("CategoryImage") %>'runat="server"Height="100"Width="100"/><asp:Labelid="txtCategory"runat="server"></asp:Label></td></tr></table></form>

Viewing all articles
Browse latest Browse all 3938

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>