I'm pretty new in ASP.net, and im trying to validate some output from my SQL DB.
I want to test if "img" from my DB is set to somthing, and if, i wan't to output it.
<asp:SqlDataSource ID="selectFromNews" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:DatabaseConnectionString1.ProviderName %>"
SelectCommand="SELECT * FROM [news] ORDER BY [time] DESC">
</asp:SqlDataSource>
<asp:Repeater ID="newsRepeater" runat="server" DataSourceID="selectFromNews" onitemcommand="newsRepeater_ItemCommand">
<HeaderTemplate></HeaderTemplate>
<ItemTemplate>
<div class="newsBox">
<h1><%# Eval("title") %></h1>
/* Test if "img" is set to somthing, and output it here, if not, do somthing else */
<p><%# Eval("text") %></p>
</div>
</ItemTemplate>
<FooterTemplate></FooterTemplate>
</asp:Repeater>
I was thinking getting the data from behindcode, and then testing and sending an output back to a Literal, but dont know how i would access the repeaters data from there?