K
Ken Cox [Microsoft MVP]
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
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