SampleWiki is a barebones wiki clone for ASP.NET written in C#. It uses the file share for data store, which means it doesn't support some of the more advanced wiki features, such as reverse linking. In the original version of SampleWiki, there were only two pages in the entire solution (wiki.ashx and edit.ashx). The Wiki logic behind those two files was less than 200 lines of C# code.

Part of the reason that SampleWiki is so simple is because it relies on the WikiRenderer library. In fact, SampleWiki's primary reason for existance was to test and demo the WikiRenderer library.

In the first version (v0.2), SampleWiki consisted of four ashx handler files: wiki, edit, versions and version.

The current version (v0.5) of SampleWiki has undergone a massive redesign (just like WikiRenderer). Instead of using ashx handlers, SampleWiki is implemented as full blown IHttpHandler. It supports all the functionallity of the previous version, leverages the new support in WikiRenderer for compiling wiki pages, and still comes in under 400 lines of code. There is also a ShowCodeHandler that outputs the generated code to the browser for debugging purposes. I've also refactored all the file access code into a provider class. This way, I could add a SQL provider along side the file system provider to enable SampleWiki to support both SQL and file system backends.

With the move to a full blown handler, the current version has a much cleaner approach to URL's - simply using the .wiki and .showcode extensions (which must be configured in IIS in order to work). It's important to note that setting up a SampleWiki site requires mapping the .wiki (and .showcode for debug support) extensions to ASP.NET in IIS.

Last edited Jul 30, 2007 at 7:26 PM by harrypierson, version 1


ntgk Sep 23, 2008 at 8:17 AM 
I downloaded the code, built it in VS.NET, setup the SampleWiki in IIS, mapped the .wiki and .showcode extensions to aspnet_isapi.dll - but when I type "http://localhost/SampleWiki/", I am getting 404 error.

So, how should I use the SampleWiki site?