Forum Moderators: open

Message Too Old, No Replies

Trimming dynamic data [paragraph]

and adding a ... + link to read full text

         

Argblat

4:39 pm on Jul 5, 2005 (gmt 0)

10+ Year Member



How do I trim the FieldValue 'Ebody' to only output a certain amount of characters, followed by a ..., and then I can add a link to the full text on another page.

Thank you in advance,
Mike
[yet unanswered question: how do I put my code into a 'code box' as I see so many people on this msg board do...it's not in the HTML style guide]

---- CODE ------

<ASP:Repeater runat="server" DataSource='<%# DSPressside.DefaultView %>'>
<ItemTemplate>
<tr>
<td width="5%" valign="top"><img src="/atg/images/flecha.gif" width="5" height="5"></td>
<td width="95%" class="sidenavbody"><a href="PresR" class="sidenavbody"><%# DSPressside.FieldValue("Eheader", Container) %></a> <%# DSPressside.FieldValue("Ebody", Container) %>... </td>
</tr>
</ItemTemplate>
</ASP:Repeater>

mrMister

4:47 pm on Jul 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming you want to limit to 99 characters...

DSPressside.FieldValue("Ebody", Container).substring(0,99) & "..."