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,155
  • 5
  • 29
  • 53

0 Answers0