ASP Repeater without DataBinder
Hi
I'm using a ASP:Repeater bound to an ArrayList as a DataSource
I have this code
<asp:Repeater id="myRepeaterPlain" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Id") %>,
<%# DataBinder.Eval(Container.DataItem, "Name") %>,
<%# DataBinder.Eval(Container.DataItem, "URL") %>,
<%# DataBinder.Eval(Container.DataItem, "Image") %>
<br />
</ItemTemplate>
</asp:Repeater>
I was wondering, how can i get the value stored in a Variable, because i would
like to do some checking before i "print" the value
It tried
<% string id = DataBinder.Eval(Container.DataItem, "Id"); %>
But i get an error with the Container saying that is not available in the scope or something
I would like to check the variable with some ifs (that's why i need it stored somewhere) like this
<% string id = DataBinder.Eval(Container.DataItem, "Id");
if(id > 100) {
%>
<h1> SOMETHING SOMETHING </h1>
<% } else { %>
<p> THIS IS JUST AN EXAMPLE </p>
<% } >
Get the idea ?
Thanks
|