Most Recent Post Widget

Topics: ASP.NET 2.0, Controls
May 17, 2012 at 11:21 AM

Is there a widget I can embed on my homepage (not where blog is) that shows teasers to most recent posts etc?



May 17, 2012 at 12:04 PM

If the homepage is outside of the BE application, then you won't be able to use a normal BE widget since the widgets can only be run within the BE application.

You could make use of a different widget that reads your blog RSS feed and displays the last few blog posts.  The could be done yourself programmatically, or there might be another component out there that does this.

One component you could use is Feedburner's BuzzBoost.  It's a JavaScript based "widget".  They give you a <script> tag you embed onto your site, and it displays the last few blog posts.  It allows you to configure it a bit in terms of how it displays and how many of the latest recent posts to display etc.

May 17, 2012 at 12:17 PM

Ahh I like that idea, thank you, I'll give buzzboost a try and let you know how it works out.



Sep 29, 2013 at 7:12 PM
Edited Sep 29, 2013 at 7:44 PM
If you prefer a server side control this code may help you . It's developed for my own purposes and you can adapt it for your purposes. I have tested and works fine, but I'm still doing more tests.

First, create a web user control and use this markup code. Note that to show the data in the client browser you can use any ASP.NET control as you want modifying the code.
<%@ Control Language="C#" (...) %>
<asp:Literal ID="_notAvailableText" runat="server"></asp:Literal>
<asp:Repeater ID="entries" runat="server">
<li><a href="<%# (((XElement)Container.DataItem).Element("link").Value)%>"><%# (((XElement)Container.DataItem).Element("title").Value)%></a></li>
And use this code in the class of the control (C# file):
public partial class <ControlName>: System.Web.UI.UserControl
        public delegate void BasicEvent();    

        private bool _binded = false;
        public int Timeout = 2000;
        public int EntriesNumber = 4;
        public string TextNotBinded = "";
        public string UrlRss { get; set; }
        public event BasicEvent BindEnded;

        public bool IsBinded
                return this._binded;
        protected void Page_Load(object sender, EventArgs e)
            if (this.UrlRss != "")
                System.Threading.Thread t =
                new System.Threading.Thread(
                    new System.Threading.ThreadStart(bindEntries));
            if (!_binded)
                this._notAvailableText.Text = this.TextNotBinded;
                this.entries.DataSource = null;
            BasicEvent ev = this.BindEnded;
            if (ev != null)

        private void bindEntries()
                XDocument x = XDocument.Load(this.UrlRss);
                this.entries.DataSource =
                    x.Descendants("item").Where((e, i) =>
                        return i < this.EntriesNumber;
                this._binded = true;
            catch (Exception)
                this._binded = false;
In the page that uses the control, you can use the following markup (don't forget the Register tag in the header like this <%@ Register Src=(...))
<uc2:LastPostsRss ID="LastPostsRss1"
            TextNotBinded="No disponible" Timeout="1000" EntriesNumber="3" runat="server" />
The process of request to blogengine rss and data binding is in another thread, so the processes of the container page will not be affected.
Set the Timeout property depending of the expected speed of your blogengine server and the max time that you want to consume in server side processing. If timeout occurs, the binding process thread will be stopped but not the process of the container page.
The BindEnded event and IsBinded property are useful to check if the blog entries has built or not, and for to do something depending of the result.
I hope that will be useful!