Say I have a textbox that I want to display the FirstName from a database I would go:
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("FirstName") %>'></asp:TextBox>
However I want to display both the First and LastName in this textbox.
Is it possible to do this using Eval using the one textbox?
One approach is to have a separate property called
FullNamethat looks like this:Then you can reference this property instead of
FirstName.Alternatively, you can use
String.Formatto combine both properties inside a singleEvalas described here.