Click here to Skip to main content
       

ASP.NET

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionHow to asp:Literal with more..?memberJassim Rahma18-Jan-13 3:19 
Hi,.
 
I am using this to display text from database within asp:Literal:
 
<asp:Literal ID="Literal1" runat="server" Text='<%# Eval("post_comment_text") %>' ></asp:Literal>
I want to know how can I limit the display to x number of characters with more link to display the full text just like the facebook comments?

 
Technology News @ www.JassimRahma.com

AnswerRe: How to asp:Literal with more..? PinmemberParwej Ahamad18-Jan-13 7:13 
Through literal you can not do in css until you putting it into label or span or div. You can truncate your string in your code the you can display here.
 
If you want to use in css then find very clear example to support most of the browser
 
http://mattsnider.com/css-string-truncation-with-ellipsis/[^]
Parwej Ahamad
 

 

AnswerRe: How to asp:Literal with more..? PinmemberNandakishorerao18-Jan-13 21:46 
when you are binding the values from any source, create another alias in your selection query.
 
ex: select fullname,left(fullname,20) as shortname from tablename
 
the 20 mentioned can be of your need.and then bind the shortname to literal.it works.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web02 | 2.6.130617.1 | Last Updated 19 Jun 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid