i have a repeater that will output a series of items:
<asp:repeater ... runat="Server">
<itemtemplate>
<a href="<%# GetItemLink(...) %>"><%# GetItemText %></a>
<itemtemplate>
<asp:repeater>
But some items will not have an associated link, so i don't want them to be clickable. i tried making it a runat=server
HtmlAnchor
, and set the htmlAnchor.Disabled = true
for the items are should not actually have a link - but they can still be clicked (it just makes the text gray)
i know how i'd do it in the olden days:
<% If IsLink Then %>
<A href="<% =GetItemLink%">
<% End If %>
<% =GetItemText %>
<% If IsLink Then %>
</A>
<% End If %>
But that's the messy mixing code and html ASP way. What's the ASP.NET way?