As you can see, if the condition is true, I attempt to use substring command to get 20 character. But it doesn’t agree.
'<%#IIf(Eval("haber").ToString().Length >= 20, Eval("haber").ToString().Substring(0, 20) + "...", Eval("haber").ToString )%>'
Also, I’m using that code on onmouseover event.
Like this:
<a href="" onmouseover=""/>
What might be the problem?
First of all: move your logic from markup to the method at codebehind and call this method in markup.
Markup:
Codebehind:
Second: you have syntax error in your expression: in the last ToString missing
()