Question about Compilers & Programming Tools
<%#System .Web.HttpUtility.HtmlEncode(Mid(DataBinder.Eval(Container.DataItem,"description"),1,20)) + "....." %>
What's wrong with the above code, What I want is that while displaying the "description" column of the database on the Repeator , It should display only 20 characters. But the whole data should save on the Data Base.
Here Every thing is working fine except the above code, I want only 20 characters only to be displayed on Repeator.
I don't know whether you understand what i mean, I will try to make to understand more by an example !
when we work on SQL Query analyser , when we type
Select * from tablename
Then the whole datas in each columns of the Table will get displayed.
suppose if we have a column named "description" , and that column have
huge amount of text datas then , it won't show the whole data on Query Analyser while we type the select Query.
After displaying some specific number of characters it will show "........."
ACTUALLY THAT FUNCTIONALITY IS THE ONE WHICH I WANT
that i want to display only specific number of characters in Repeator control. here i want to display only 20 characters.
CAN YOU PLEASE HELP ME
You need to change the column type from BoundField to TemplateField and call the substring method like this
In this snippet, I am displaying only the first 25 characters of the Comments field.Only problem with this approach is that if even one of the rows contains a comments field with less than 25 characters, this might trigger an error.The fool proof way then is to write a small function in codebehind which will check the length of the field, chop off any extra characters and in case of shorter strings,
( THANKING " Balgates " For this HELP )
Posted on May 05, 2008
Tips for a great answer:
Jun 26, 2010 | Microsoft ASP.NET Programming with MS...
Jun 02, 2010 | Microsoft ASP.NET Programming with MS...
May 31, 2010 | Microsoft ASP.NET Programming with MS...
Dec 12, 2009 | Microsoft Visual Basic Enterprise Edition...
Nov 07, 2009 | Microsoft Compilers & Programming Tools
Jul 10, 2009 | Microsoft Compilers & Programming Tools
May 03, 2009 | Microsoft Visual Basic Enterprise Edition...
Mar 17, 2009 | Microsoft Compilers & Programming Tools
Mar 07, 2009 | ComponentOne WebReports For ASP.NET...
Dec 21, 2008 | Microsoft ASP NET WEB MATRIX (583797)
Oct 06, 2016 | The PHP Group PHP
179 people viewed this question
Usually answered in minutes!
Step 2: Please assign your manual to a product: