On Wed, 27 Jul 2005 11:27:03 -0500, Ed Chiu""
<Ed****@discuss ions.microsoft. com> wrote:
Hi,
I have the following item template in a datalist:
<asp:LinkButt on id="lnkAction" runat="server" CommandName="Ac tion"
cssClass="TabMe nu">
<%# Container.DataI tem("Title") %>
</asp:LinkButton>
This is working fine until I was asked to made this template conditional
based on
the content of <%# Container.DataI tem("Title") %>. Say if it is "A" or
"B"
or "C", the template will be a LinkButton, every thing else will be a
Label.
I don't know how to do that.
Please help !
Somewhat ironically, I happened to be looking for something this morning
and ran across this article:
http://www.devx.com/vb2themax/Article/19908
I wasn't looking for that, I just happened to glance at it before moving
on....I assume by its title it does what you want, hopefully not
off-topic...
Note you could also use panels or placeholders inside the template and set
the visible property using databinding as well; it adds a little extra
processing as you're loading both controls, then showing/hiding according
to your title value; but I also don't know how 'complex' your templates
get, or the article I linked to, how complex that is....
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET