Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Limiting characters brought back from a datalist.

Reply
Thread Tools

Limiting characters brought back from a datalist.

 
 
Roffers
Guest
Posts: n/a
 
      09-18-2006
Hi everyone.

I've got this problem that I really have no idea how to solve.

I have a datalist that brings back x amount of rows, I need to limit
this datalist by 100 characters and then append a "..." to the end.

<aspataList id="dlDataList" runat="server"
RepeatDirection="Horizontal" RepeatLayout="Flow">
<ItemTemplate>
<asp:LinkButton Runat="server"
ID="lnkbtn1"><%#DataBinder.Eval(Container.DataItem ,
"vc_desc")%></asp:LinkButton>
</ItemTemplate>
<AlternatingItemTemplate>
, <asp:LinkButton Runat="server"
ID="lnkbtn2"><%#DataBinder.Eval(Container.DataItem ,
"vc_desc")%></asp:LinkButton>
</AlternatingItemTemplate>
</aspataList>

You'll see that the list currently gets rendered like
Item1, Item2, Item3, Item4

I need it to be
Item1, Item2, Item3, Ite...

Can anyone point me in the right direction?

Any help would be appreciated.
Mark

 
Reply With Quote
 
 
 
 
jb
Guest
Posts: n/a
 
      09-18-2006
Roffers wrote:
> Hi everyone.
>
> I've got this problem that I really have no idea how to solve.
>
> I have a datalist that brings back x amount of rows, I need to limit
> this datalist by 100 characters and then append a "..." to the end.
>
> <aspataList id="dlDataList" runat="server"
> RepeatDirection="Horizontal" RepeatLayout="Flow">
> <ItemTemplate>
> <asp:LinkButton Runat="server"
> ID="lnkbtn1"><%#DataBinder.Eval(Container.DataItem ,
> "vc_desc")%></asp:LinkButton>
> </ItemTemplate>
> <AlternatingItemTemplate>
> , <asp:LinkButton Runat="server"
> ID="lnkbtn2"><%#DataBinder.Eval(Container.DataItem ,
> "vc_desc")%></asp:LinkButton>
> </AlternatingItemTemplate>
> </aspataList>
>
> You'll see that the list currently gets rendered like
> Item1, Item2, Item3, Item4
>
> I need it to be
> Item1, Item2, Item3, Ite...
>
> Can anyone point me in the right direction?
>
> Any help would be appreciated.
> Mark
>

Mark

You need to add handler for the itemdatabound event. There are plenty of
examples around.

jai
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
6500: User-Based Rate Limiting AND Total Rate Limiting Patrick Cervicek Cisco 0 08-07-2007 03:07 PM
Anyone brought the Phillips Skype VOIP321 phone? Beds UK VOIP 0 07-08-2006 09:49 AM
7206vxr CRC errors on FE0/0 when Serial1/0:0 brought up Allen Cisco 4 06-21-2004 04:46 AM
PyGTK website is down. Anybody knows why and when it will be brought up? Hans Deragon Python 2 10-11-2003 04:42 PM
Who's brought a Philips DVD R80 ? amstereofan DVD Video 2 08-12-2003 11:43 PM



Advertisments