PDA

Click to See Complete Forum and Search --> : Data bound DataList Template


TomGibbons
Jul 1st, 2005, 11:34 AM
I have the following in my ItemTemplate: <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:

Norkis
Jul 4th, 2005, 03:34 AM
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.