It might be simpler to pass lname and fname into a helper function that
would return the string in the format that you want. Here's the idea:
<asp:templatecolumn headertext="ProductID">
<itemtemplate>
<asp:Label runat="server" Text='<%#
fixit(DataBinder.Eval(Container, "DataItem.ProductID")) %>'>
</asp:label>
</itemtemplate>
</asp:templatecolumn>
Here's how my function looks in VB:
Public Function fixit _
(ByVal intID As Integer) As String
If intID = 10 Then
Return "message" & intID.ToString
Else
Return "message"
End If
"Charlie@CBFC" <ch*****@comcast.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi:
Is it possible to apply formatting to above statements which insert field
values into HTML when binding to a datasource using Repeater control? For
example, I would like to trim trailing spaces. Also, I have tried things
like this, but can't get them to work:
<%# DataBinder.Eval(Container.DataItem, "lname") +
((DataBinder.Eval(Container.DataItem, "some_field")=="")?"":", ") +
DataBinder.Eval(Container.DataItem, "fname")%>
I would like to apply a little logic to these statements to clean up
formatting. Can some one show me how or some examples?
Thanks,
Charlie