BlogEngine.NET extension: Detailed Download Counter

Lately, I have been posting some source code and I wanted to know how many times the source code was downloaded. I searched the internet and quickly found an Extensions page on the official BlogEngine.NET website. I noticed there were several different download counters available. I will list them here shortly with the cons and the pros.

1) Counter Extension by RTur

  • Stores every download (so advanced statistics are available)
  • The overview is not an overview (counts per file are not available)

2) Simply Download Counter by Al Nyveldt

  • Download count is displayed in the blog posts itself
  • No settings available to determine who can view the download count
  • Downloads are not stored separate (only the number of downloads per file)

3) File Download Tracker by Chris Blakenship

  • It shows a good overview which file is downloaded how many times
  • Downloads are not stored seapare (only the last download date and the number of downloads per file)

None of these counters could provide the functionality I really wanted. I simply wanted a counter that allowed me to decide at run-time whether I wanted anonymous users to be able to view the number of downloads. Also, I wanted a more structured way of storing and viewing the downloads per file. Since the original extensions didn't too look difficult, I decided to dive into the world of BlogEngine.NET extensions.

What I have developed is a solution that fits my needs (and probably others as well). The Detailed Download Counter saves the information per file, but also stores the timestamp, user agent and user host. This gives anyone the ability to create more advanced statistics. For the moment, I have only implemented a grid which simply shows an overview of the files downloaded and the details of a file. To get a grip of the current implementation, please view the image below:

To install the Detailed Download Counter extension, simply extract the zip file to the root or your BlogEngine.NET application. 

DetailedDownloadCounter.zip (6.69 kb) [Downloads: 196]

kick it on DotNetKicks.com

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

ASP.NET Content Management System

Sometimes, you are surfing the web looking for something that you simply can't find. Quite some time ago, I had this problem. I have developed the website CatenaLogic.com including it's store myself. However, everything was fixed and changing some text required me to completely rebuild and upload the website. This was a horrible task. At the time of development (about 2 years ago), I already looked for some ASP.NET content management systems (from now on I'll call it CMS), but only found DotNetNuke (and some other projects). However, the downside of DNN is that the learning curve is very steep and the integration is much too hard. Turning an existing website into DNN is (at least for me) a horrible task.

About 4 months ago, I decided to upgrade the website to implement better support for multiple payment methods, and I started searching the internet again for an ASP.NET CMS. The reason I don't write it myself is because I don't want to do the job that a lot of people did before me. Then I found it, the golden grail:

N2 CMS

N2 CMS is an open source content management system that lets the developer decide how to do the integration. Simply said, N2 CMS simple stores the data for you and you can retrieve it from the database via the N2 interface. This is the minimum you have to do to use N2 CMS. However, there is also a fully supported templates project that provides a lot of basic controls to build a simple website. For a great example, visit the N2 CMS Templates Page.

N2 CMS is also available on CodePlex.

kick it on DotNetKicks.com

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

ASP.NET Web Application types not found

Introduction 
When I was converting a Web site to a ASP.NET Web Application project in Visual Studio 2008, all my classes in the App_Code folder were not recognized any longer.

After some small investigation, it seemed that App_Code cannot be used in an ASP.NET Web Application project in Visual Studio (2005/2008). So, I put all the classes, before located in App_Code, to subfolders of the project and added the corresponding namespaces.

Problem
However, I was still getting the following compile error:

Error 129 The type or namespace name 'MyClass' could not be found (are you missing a using directive or an assembly reference?)

After googling for this problem, I still couldn't find the problem. Then I thought: wait, are the classes even being compiled? No, the classes were actually not compiled. Somehow, the classes were set as content.

Fix
Select the file that is not being compiled in the solution explorer and view its properties (hit F4). Make sure the Build Action is set to Compile, and not to Content (which was the case with my project).

kick it on DotNetKicks.com

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList