Question about Computers & Internet
<%#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
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
Posted on Jan 02, 2017
Tips for a great answer:
Nov 07, 2009 | Microsoft Computers & Internet
Jul 10, 2009 | Microsoft Computers & Internet
Apr 28, 2009 | Computers & Internet
Apr 03, 2009 | Microsoft Access 2000
Mar 17, 2009 | Microsoft Computers & Internet
Mar 07, 2009 | ComponentOne WebReports For ASP.NET...
Sep 25, 2008 | Dell Dimension 5100 (D51L1) PC Desktop
Nov 15, 2007 | Sharp AR-5316 Advanced Digital Imager...
179 people viewed this question
Usually answered in minutes!