0

I have a div in which i assign some text using the following dynamic text.

<div class="name"><%#Eval("Name")%></div>

Now i want to add '...' if the length of the parmater 'Name' > 12. I tried the following code but it fails.

<% #Eval("Name").ToString().Length <= 12 ? Eval("Name") : Eval("Name").ToString().Substring(0, 12)+"..." % >
MarsOne
  • 2,075
  • 4
  • 26
  • 50

0 Answers0