Community Server 1.1 Latest Posts control

Community Server 1.1 Latest Posts control

I took the latest forum posts control from Christian Nordbakk and turned it into a control to use on SCCAForums.com

The differences are that my control

  • displays the latest post made 
  • links to the last post made instead of the first
  • shows the user who made the last post
  • shows the forum the post was made in

You can change some of the settings for this control such as the number of posts returned, by looking at the GetThreads() method in the code.

If you want to use this control please feel free to do so. You'll need to download the control here (rename it from latestforumsposts.txt to latestforumposts.ascx) and place it in the root of your CS folder, eventually I'll get around to making this control part of my CJHControls package, but for now you can just use it as is. It won't work in the themes/default/skins/ folder without some further changes.

To put it on your main page you need to add the following to the top of your default.aspx file

<%@ Register TagPrefix="LatestForumPostsControl" TagName="LatestForumPosts" SRC="LatestForumPosts.ascx" %>

and then add this line to the page

<LatestForumPostsControl:LatestForumPosts Runat="Server" ID="Latestforumposts1" NAME="Latestforumposts1"/>

Recent Comments

Comment Avatar
This does not work for me. It's probably a silly error on my part. I noticed, though, that your directions need tweaking; latestForumsPosts.txt will need to be renamed to LatestForumPosts.ascx (singular Forum) and the Register TagPrefix cannot be placed twice on the /Default.aspx page as you suggest.

I look forward to getting this to work.

Before moving things around on my site the other day, I had a control working and thought it was yours. Alas, I do not have a backup for that page. Silly me.

Any thoughts on how your page is set would be appreciated.
Posted By: Anonymous Poster on Aug 2005
Comment Avatar
I've tweaked the instructions to note the file name differences.
Though I'm not sure where you are seeing that I say you must place the register tagprefix on the same page twice?
Posted By: Anonymous Poster on Aug 2005
Comment Avatar
Interesting, after you replied the second Register tag is gone. Hmm.. Anyway. Thanks for updating the instructions. I am placing the following on /Default.aspx;

<Blog:AggregatePostList runat="Server" />
<LatestForumPostsControl:LatestForumPosts runat="Server" ID="LatestForumPosts" NAME="LatestForumPosts"/>

The blog list shows but no forums code. I placed it on another site and it showed code until I did a refresh and nothing showed until I went into the forums and came back. I'm rebooting the server to see if something is confused :)

Sometimes an error is thrown. I will copy it to you too if it happens again.

Thank you for your help.
Posted By: Anonymous Poster on Aug 2005
Comment Avatar
Checked both sites and the control was working. Added a post to one site and the other one threw this error. The one I've seen a few times now.

Object reference not set to an instance of an object. This code is highlighted.

<br /> in <a href="<%# ForumUrls.Instance().Forum( ((Thread) Container.DataItem).SectionID ) %>">
Posted By: Anonymous Poster on Aug 2005
Comment Avatar
I can't say I've seen that error before :(
Posted By: Anonymous Poster on Aug 2005

Add Comment

Please add your comment by filling out the field(s) below. Your comment may need to be approved before it becomes visible.
Enter your first name for display with the comment
Enter your last name for display with the comment.
Enter your comment here.
If you can't type DNNRocks in, you can't post, plain and simple.
Submit Comment Cancel

Chris Hammond

Chris Hammond is a father, husband, leader, software developer, photographer and car guy. Chris focuses on the latest in technology including artificial intelligence (AI) and has spent decades becoming an expert in ASP.NET and DotNetNuke (DNN) development. You will find a variety of posts relating to those topics here on the website. For more information check out the about Chris Hammond page.

Find me on Twitter, GitHub and LinkedIn.