How to concatenate static text in the start of Eval("")
in asp.net?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
try...
Text='<%# "Mr " + Eval("FirstName") + " " + Eval("LastName")%>'
回答2:
For concating two fields from db you can use string.Concat function in eval()
Text='<%# string.Concat(Eval("FirstName"), " ", Eval("LastName"))%>'
回答3:
This works fine for me:
<%#Class.something.ToString() & Eval("something_to_eval")%>
回答4:
Doing this (without single quote) worked for me. And Visual Studio underlines it as a Validation warning.
onclick=<%# "modCbClick('#tbl_" + Eval("ModCode") + "', this)" %>
回答5:
try this: Text='<%# string.Concat("Table No:", " ", Eval("table_no")) %>'