Data bound DataList Template
I have the following in my ItemTemplate:
Code:
<div style="font-size: 7pt; font-style: italic; text-align: right;">
Added by <%# DataBinder.Eval(Container.DataItem, "addedbyname")%> @ <%# DataBinder.Eval(Container.DataItem, "added") %><br />
Modified by <%# DataBinder.Eval(Container.DataItem, "updatedbyname") %> @ <%# DataBinder.Eval(Container.DataItem, "updated") %>
</div>
Is there any way to hide the 'Modified By... ' line if 'updated' and 'added' are the same? If so, how?
Thanks :wave:
Re: Data bound DataList Template
Yes, there is and I think more then one way to do this.
I think it can be done in this way:
Reaplace code with <% FunctionName(container) %> or you can bound function to label.text property.
Pass dataitem to function. Write your own logic in function to check values and return custom text.
There must be some samples on web, I haven't it right now. Search for it.
Hope helped.