Hello,
I am newbie at ASP.net. I got stuck at a point that hopefully you can help me.
I use mssql as database and fetch all my records and images from there by using <asp:SqlDataSource>. I also use
<asp:Repeater>
to show data at every iteration. After fetching data from database, it is easy to show string by using
<%# Eval("someData") %>
.
but how can i show the data that comes as image type from database? It is not possible to show an image like this
<img src="<%# Eval("imageTypedData") %>" />
:(
Because image source needs an url!
My source code is like this if you need to imagine big picture.
<asp:Repeater ID="Repeater1" DataSourceID="IDEAS" runat="server">
<HeaderTemplate>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<h2 class="title">
<%# Eval("title")%></h2>
</td>
</tr>
<tr>
<td>
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="35%">
<a class="title" href='<%# Eval("e-mail") %>'>
<%# Eval("name") + " " + Eval("surname") %></a>
</td>
<td width="65%">
Tarih
<%# Eval("date")%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<dx:ASPxRatingControl ID="ASPxRatingControl1" runat="server" ItemCount="10" Value='<%# Eval("rating") %>'>
</dx:ASPxRatingControl>
</td>
</tr>
<!-- Yorumun başladığı yer -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" width="14%" id="profilePic">
<img src='<%# Eval("imageTypedData")' alt="image" %>" /><!-- PROBLEM IS HERE!!!-->
</td>
<td width="84%">
<p class="post">
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text='<%# Eval("idea") %>'>
</dx:ASPxLabel>
</p>
</td>
</tr>
</table>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<table width="100%">
<td colspan="1">
<hr />
</td>
</table>
</tr>
</SeparatorTemplate>
<FooterTemplate>
</table>
<p>
</p>
</FooterTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="IDEAS" runat="server" ConnectionString="<%$ ConnectionStrings:INNOVATIONConnectionString %>"
SelectCommand="INO_SEL_FETCHIDEA_SP" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="searchType" SessionField="searchType" DefaultValue="0" />
</SelectParameters>
</asp:SqlDataSource>