Posted on 2004-11-22
Medium Priority
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

MikeMCSD earned 2000 total points
ID: 12675498

one thing I noticed is javascript is spelled wrong here:

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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

850 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