Posted on 2004-11-22
Last Modified: 2006-11-17
 I have a datagrid in which i have a template column. Iam trying the following code

<asp:TemplateColumn HeaderText="JobTitle">

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

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.
Question by:pradeepy
    1 Comment
    LVL 16

    Accepted Solution


    one thing I noticed is javascript is spelled wrong here:

    <asp:Label runat="server" Text= "javascrpit: <<<

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now