Random Post Control for BlogEngine.Net

First of all, this control is not developed by me. I have just downloaded and made some changes to the control written by Paul Tumelty,  you can read more and download about the Random Post Link Generator Control for BlogEngine.Net he developed.

I made few changes,

1. when I used it in my BlogEngine.Net version 2, it showed error, so I changed the namespace that fixed the issue.

2. Added an option to enter number of links to be choose (in the html you can change that with LinkCount

3. If the LinkTitle is blank it will display the post title now.

4. Changed the Random post selection a bit so that when multiple random posts are selected repetition happened.

5. If link Title is given and LinkCount is more than one it will show like

LinkTitle 1

LinkTitle 2


All the credit of this control goes to Paul Tumelty who developed this control.

How to use

1. Download the control from here RandomPost.zip (1.04 kb)

2. Unzip and copy the RandomPost.cs to \App_Code\Controls

3. in the Master page where you need to display this add the following line

<blog:RandomPost ID="RandomPost1"  LinkCount="NUMBER OF RANDOM POSTS TO DISPLAY" LinkTitle="CUSTOM TITLE" runat="server" />

If you want to show the actual post title Don’t enter any value to LinkTitle

<blog:RandomPost ID="RandomPost1"  LinkCount="NUMBER OF RANDOM POSTS TO DISPLAY" LinkTitle="" runat="server" />

You can see the Random post control active on the left side. (just above twitter updates).

<blog:RandomPost ID="RandomPost"  LinkCount="5" LinkTitle="" runat="server" />