Link to home
Start Free TrialLog in
Avatar of pradeepy
pradeepy

asked on

jAVASCRIPT IN TEXT TAG OF ITEMTEMPLATE

Hi,
 I have a datagrid in which i have a template column. Iam trying the following code

<asp:TemplateColumn HeaderText="JobTitle">

<ItemTemplate>
                                
                           
<asp:Label runat="server" Text= "javascrpit:if('<%# DataBinder.Eval(Container, "DataItem.jobtitle").ToString().Length %>' > 40 )"  '<%# DataBinder.Eval(Container, "DataItem.jobtitle").ToString().SubString(0,40) %>';>
            </asp:Label>
                                                      
</ItemTemplate>
</asp:TemplateColumn>

Iam writing a javascript code within text tag of item template

The condition is if jobtitle is greater than 40 take the first 40 characters of jobtitle.

However it is giving an error as server tag not well formed. Can any one tell me what the correct javascript code is.

Any comments and suggestions are welcome.

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of MikeMCSD
MikeMCSD
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial