Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concatenate text with Eval

How to concatenate static text in the start of Eval("") in asp.net?

like image 768
israr Avatar asked Feb 24 '11 05:02

israr


People also ask

How do I join two strings in Splunk?

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.

What is the use of eval in C#?

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.

What is use of Databinder eval in asp net?

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.


3 Answers

try...

Text='<%# "Mr " + Eval("FirstName") + " " + Eval("LastName")%>'
like image 102
Muhammad Akhtar Avatar answered Nov 08 '22 02:11

Muhammad Akhtar


For concating two fields from db you can use string.Concat function in eval()

 Text='<%# string.Concat(Eval("FirstName"), " ", Eval("LastName"))%>'
like image 36
Tarun Gupta Avatar answered Nov 08 '22 02:11

Tarun Gupta


try this: Text='<%# string.Concat("Table No:", " ", Eval("table_no")) %>'

like image 31
Arpita Srivastava Avatar answered Nov 08 '22 04:11

Arpita Srivastava