P
Peter Morris
<ItemTemplate>
<tr class="DataListStyle">
<td><%# Html.Encode((string)DataBinder.Eval(Container.DataItem, "Title"))
%></td>
<td><a href="/Advert/Modify/<%# Eval("ID") %>">Modify</a></td>
<td>
<% if ((bool)DataBinder.Eval(Container.DataItem, "CanPublish")) { %>
<a href="/Advert/Publish/<%# Eval("ID") %>" onclick="return
confirm('Re-publish this advert?');">
Publish</a>
<% } %>
<% if ((bool)Eval("CanWithdraw")) { %>
<a href="/Advert/Withdraw/<%# Eval("ID") %>" onclick="return
confirm('Withdraw this advert?');">
Withdraw</a>
<% } %>
</td>
</tr>
</ItemTemplate>
Can someone please tell me how I am supposed to implement the <% if %>
statements in the above markup? I am using the Web Extensions so I don't
have a <form runat="server">. This is annoying me Surely it should be
simple enough to output different HTML depending on a boolean?
Thanks
Pete
<tr class="DataListStyle">
<td><%# Html.Encode((string)DataBinder.Eval(Container.DataItem, "Title"))
%></td>
<td><a href="/Advert/Modify/<%# Eval("ID") %>">Modify</a></td>
<td>
<% if ((bool)DataBinder.Eval(Container.DataItem, "CanPublish")) { %>
<a href="/Advert/Publish/<%# Eval("ID") %>" onclick="return
confirm('Re-publish this advert?');">
Publish</a>
<% } %>
<% if ((bool)Eval("CanWithdraw")) { %>
<a href="/Advert/Withdraw/<%# Eval("ID") %>" onclick="return
confirm('Withdraw this advert?');">
Withdraw</a>
<% } %>
</td>
</tr>
</ItemTemplate>
Can someone please tell me how I am supposed to implement the <% if %>
statements in the above markup? I am using the Web Extensions so I don't
have a <form runat="server">. This is annoying me Surely it should be
simple enough to output different HTML depending on a boolean?
Thanks
Pete