Bill Robertson's Blog

CS Recent Blog Post Sidebar

This is a UserControl I wrote because I wanted to show the most recent posts for a specific blog littered throughout my site.  Place this control in a directory and reference it like a regular user control. 

<%@ Register TagPrefix="BR" src="~/UserControls/RecentPostsSideBar.ascx" TagName="RecentPostsSideBar" %>

<BR:RecentPostsSideBar id="fdr_rp" runat="server" EnableViewState="false" Title="Recent Podcasts" AppKey="podcast" />

  • AppKey -- the name of the blog you want the most recent posts to appear.
  • Title -- the text for the header of the content area.
  • PageSize -- the number of records to show, defaults to 5. 

The snippet above will pull the most recent 5 posts from the blog called "podcast" and display them with the title of Podcast. 

CS Recent Blog Post Sidebar

Let me know what you think.

Comments

Dalamar said:

Ah Great! Just what I was looking for. Spent 2 days on google trying to find something and then stumbled on this when looking for something else. Great work!

Again thanks!

# January 13, 2007 12:02 PM

Dalamar said:

Question: How hard would it be to change this so it shows blog post that are set to the future instead of the last 5. This would be a great way to show "upcoming events". I looked at the code, but its just over my head (stop coding for the most part at classic asp).

Just asking...

~Dal

# January 14, 2007 8:55 AM