DevNewz News Archives About Us Feedback

Recent Articles


Programmer Or Coder?
Are programmers and Coders the most neglected link in the Software Development Chain? Coders are like smart assembly line workers as opposed to programmers...

Would Everyone Even WANT To Write Software?
Like many of you, I suspect, I found Awaiting the Day When Everyone Writes Software (you may need to register) in the New York Times interesting. While I...

Implementing PICS And P3P In ASP.NET Headers
PICS (Platform for Internet Content Selection) and P3P (Platform for Privacy Preferences) are two really nice things to be aware of when developing web applications. If your website targets children, maybe you sell toys...

Integrating W/ (Future) Competition
Alex Fletcher has a nice list of hypothetical new year's resolutions for the open source community. I started thinking about his first resolution: "Enable ease...

Software Test Automation And Strategy
Companies are turning to automated testing tools more often than ever before to ensure that their applications are working properly prior to deployment. That is particularly important today as more and more...

The Oddness (and Evenness) Of Spry 1.4
Ok, I'm not sure if "evenness" is really a word, but if Steve Colbert can make stuff up - so can I. Before Spry 1.4, Spry supported a simple way to apply different CSS styles to datasets rows to support even/odd colors.

JavaScript: Alert.Show(”message”) From ASP.NET...
In highly interactive websites and intranet sites, you probably want to let the users know what's going on when they delete, save, export etc. on the site. Those kinds...


03.07.07


Dynamic Blogroll For ASP.NET

By Mads Kristensen

The blogroll has become a standard element on most blogs today.

If it is an ASP.NET blog, the blogroll probably contains links to other ASP.NET blogs and that gives the visitor an opportunity to surf to other related websites. The only problem with it is that you have no idea what to expect from the blogs by looking at the blogroll. Most often, the link title on the blogroll contains the name of the author and if you don't know him/her on beforehand, you have no idea if it's a related blog or not.

That got me thinking about a way to tell a little more than just the name of the authors. Why not display the titles of their 3 latest posts so the visitor quickly can see what the blogs are about?



By showing the newest posts beneath each blog we also stop the visitor from leaving your site for an unrelated one.

The code

In order to display the latest posts we need to parse all the blog's RSS feed, which means that we have to retrieve them first. That is time consuming, so it has to be done asynchronously so it doesn't slow the entire page down. It doesn't have to be updated with each request but only every hour or whenever you see fit. By each update it still mustn't slow the page and I found a way to do that.

Low Rate eCommerce & Retail Plans

The first time the blogroll is created it displays the blogroll without the latest posts. After it has retrieved the feeds it adds them beneath each blog. It takes less than a second per blog and is cached until the blogroll will be updated. The default is one hour.
Implementation

The blogroll is a user control and you add blogs to it like this:



There are 3 properties to set:

•  MaxLength: The maximum number of characters to display for each post

•  MinutesCached: The number of minutes before it updates the posts

•  VisiblePosts: The number of posts to show beneath each blog

Download

blogroll.zip (2,66 KB)

Comments


About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

About DevNewz
DevNewz has assembled experts around the world to deliver helpful advice to application developers. Our in-house news staff focuses on keeping you updated with the latest new software and trends in application development. DevNewz provides Knowlege For Application Developers.

DevNewz is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITmanagementNews.com


-- DevNewz is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2007 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


Knowlege For Application Developers DevNewz Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact