How to concatenate static text in the start of Eval("")
in asp.net?
The 'allrequired=f' flag also allows you to concatenate the fields that exist and ignore those that don't. The above will combine the three fields, 'email', 'uname', and 'secondaryuname' into the single field 'identity', delimitating by the pipe character.
Eval function is used to bind data to control inside a DataBound control, but it cannot update the values back to the database. Bind function can be used to bind data to control inside a DataBound control and also it can update the values back to the database.
Eval) function is used to bind data in controls inside GridView, DataList, Repeater, DetailsView, etc. and using string. Format multiple values can be set to a single control.
try...
Text='<%# "Mr " + Eval("FirstName") + " " + Eval("LastName")%>'
For concating two fields from db you can use string.Concat function in eval()
Text='<%# string.Concat(Eval("FirstName"), " ", Eval("LastName"))%>'
try this: Text='<%# string.Concat("Table No:", " ", Eval("table_no")) %>'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With