473,382 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to truncate retrieved records and provide link for full record

Hello-
I'm sure this has been asked and answered before since it is a common
technique, but I can't seem to get the search terms needed to get me
an answer, so I thought I would post here.

I have a page that displays news and events when the page loads,
Sometimes the descriptions of these items are long enough that I would
like to have the description go on for, say, twenty-five words and
then have a "More" link where the complete item data can be displayed
on a new page.

Spinning off a new page from a a master is not a problem; what I am
trying to figure out is how to automatically due the truncating of the
description. Any help or direct link would be much appreciated. I am
working in VS2008/asp.net 2.0.

Thanks,
Paul
Jun 27 '08 #1
2 965
Hello pauld,

You can use the CSS to limit the text lenght with text-overflow: ellipse;,
but if you need to limit nubmer of rows just set the fixed number or rows
and then add "more.." manually

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
pHello-
pI'm sure this has been asked and answered before since it is a common
ptechnique, but I can't seem to get the search terms needed to get me
pan answer, so I thought I would post here.
pI have a page that displays news and events when the page loads,
pSometimes the descriptions of these items are long enough that I
pwould like to have the description go on for, say, twenty-five words
pand then have a "More" link where the complete item data can be
pdisplayed on a new page.
p>
pSpinning off a new page from a a master is not a problem; what I am
ptrying to figure out is how to automatically due the truncating of
pthe description. Any help or direct link would be much appreciated. I
pam working in VS2008/asp.net 2.0.
p>
pThanks,
pPaul
Jun 27 '08 #2
On Jun 2, 6:22 pm, Michael Nemtsev [MVP] <nemt...@msn.comwrote:
Hello pauld,

You can use the CSS to limit the text lenght with text-overflow: ellipse;,
but if you need to limit nubmer of rows just set the fixed number or rows
and then add "more.." manually
Michael,
Thank you for taking the time to reply. I wonder if you could
elaborate on either of these methods...
If I am understanding text.overflow, it likely would not be
appropriate since it is based upon widths.

The row count is probably a more likely candidate, but the "add
manually" part is not ideal. I wonder if you could tell me how, for
example, Google groups is doing their truncation when you look at the
message list for any given group? This is exactly what I want to do. I
imagine it is either via word count or rows, with a [pseudocode]: if
rowcount>x, then add a link called "More" with a URL to a page that
is all of the text associated.

As I said, getting the page for a given item is not a problem; it is
the truncation code that will create the "More" link when the row
count exceeds x.

Thanks again and sorry if I am being dense,
Paul

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog:http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

pHello-
pI'm sure this has been asked and answered before since it is a common
ptechnique, but I can't seem to get the search terms needed to get me
pan answer, so I thought I would post here.
pI have a page that displays news and events when the page loads,
pSometimes the descriptions of these items are long enough that I
pwould like to have the description go on for, say, twenty-five words
pand then have a "More" link where the complete item data can be
pdisplayed on a new page.
p>
pSpinning off a new page from a a master is not a problem; what I am
ptrying to figure out is how to automatically due the truncating of
pthe description. Any help or direct link would be much appreciated. I
pam working in VS2008/asp.net 2.0.
p>
pThanks,
pPaul
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: New MSSQL DBA | last post by:
I have recently been assigned to take over several MSSQL environments and found some of the existing practice confusing. As most of my previous experiences are on Oracle and Unix platform so would...
3
by: asad | last post by:
Hello, I'm working on a Articles Website.There are many Article categories.when user click on a particular category he/she will got Article records with paging. Problem is that i want to show...
5
by: ronin 47th | last post by:
Hi group, In one of the books 'Gurus Guide to Transact SQL' i found this info: ------------------------------------------------------------ TRUNCATE TABLE empties a table without logging row...
3
by: Rashapoo | last post by:
I have just completed a basic course in Access. I have some relational b/g in DB2 and Cobol. I have a question my instructor couldn't answer (or maybe I didn't explain myself) I design a...
11
by: kaisersose1995 | last post by:
Hi, I've got an import procedure working, using a standard import specification to import a .csv file into a temporary table. The problem i'm having is that i have 4 different sets of borrower...
15
by: Hexman | last post by:
Hello All, How do I limit the number of detail records selected in a Master-Detail set using SQL? I want to select all master records for a date, but only the first 3 records for the details...
3
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we...
3
by: Jejune | last post by:
I'd like to thank snavebelac for his help so far in this problem. I'm am working with ASP and I'm am filtering results from an Access DB. I have the season, year and designer stored in the...
5
by: Timothy Madden | last post by:
Hello I see there is now why to truncate a file (in C or C++) and that I have to use platform-specific functions for truncating files. Anyone knows why ? I mean C/C++ evolved over many years...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.