FlexWiki doesn't get ASP.Net

Note: this entry has moved.

A few weeks ago I had the chance to peek at the FlexWiki source code while helping a team that was trying to integrate a Wiki into an existent website. All my suggestions to them, like “write a custom control to do this or the other” had the effect of only confuse them even more. They were worried about “how to do that in FlexWiki”. Well… it’s an ASP.Net application so you should not have much trouble adding an extra control for instance, that was my simple reasoning, until I saw FlexWiki soure code, of course.

 

What I saw was really some of the worst coding practices you could use for an ASP.Net application. But the real surprise came after I read the 2nd line that is in every source file:

 

// Copyright (c) Microsoft Corporation.  All rights reserved.

 

 

This worried me a bit… -- Why is a Microsoft copyrighted ASP.Net application using some of the worst coding practices for a web application?

 

Inside the ugly

 

You probably remember ASP 3.0 common code like the following:

 

Response.Write (“MyMessyAndImpossibleToMantainMarkupGoesHere”)

 

Well… FlexWiki contains more than 400 (that is, four hundred) calls to Response.Write and some of them like the one found at WikiEdit.aspx.cs:432 output ~3Kb of html in a single call, that’s as ugly as it can get regarding usage of Response.Write. This includes hard coded CSS class selectors, hard coded markup, etc, thus making customization of “the thing” really a hard task.

 

But besides the common “bad-usage-of-Response.Write” syndrome that you will find in FlexWiki and some other web apps out there what is really incredible is that FlexWiki doesn’t use any of the major ASP.Net features!! No controls, no state management, etc. I guess if you rename FlexWiki pages from “.aspx” to “.asp” they may even work in ASP 3.0!! J

 

Getting uglier

 

By looking at Default.aspx you can easily tell that all its doing is spitting out chunks of hard coded markup and javascript code in a never ending method of ~200 lines in length named DoPage. This is very similar to the rest of the pages they use.

 

So their approach basically seems to consist in having an .aspx page with the following:

 

<%@ Page language="c#" Codebehind="ShowNewsletter.aspx.cs" AutoEventWireup="false" Inherits="FlexWiki.Web.ShowNewsletter" %>

<% DoPage(); %>

 

And a huge DoPage method with all the hard coded markup and script into a corresponding aspx.cs file.

 

Where are the controls taking to each other, firing events, maintaining state, etc. You won’t find that in FlexWiki, I’m afraid.

 

So if you ever try to extend it, for instance, adding a CAPTCHA control for validating edits, you are on your own, spending lot of time because of FlexWiki “architecture”.

 

It’s also hard to understand the reason why if they really wanted to use the DoPage approach (which just in case you haven’t noticed already I think it’s nasty) they did not go for a custom IHttpHandler implementation… (why having a full featured Page when all you’re doing is calling Response.Write?).

Published Wednesday, August 17, 2005 10:50 PM by vga
Filed under:

Comments

# re: FlexWiki doesn't get ASP.Net

Thursday, August 18, 2005 1:00 AM by Kannan
If I remember this from a channel9 interview this was done by some PM to get a taste of .net programming, so its like writing a piece of code to learn something here he chose to write a wiki, thats it.

# re: FlexWiki doesn't get ASP.Net

Thursday, August 18, 2005 8:41 AM by AndrewSeven
A PM?
Did he not learn enough to see that that kind of stuff makes MS look bad?

Was it a fast port from an asp3 app?

# re: FlexWiki doesn't get ASP.Net

Thursday, August 18, 2005 3:51 PM by Eric Newton
Oh, thats not the first! IBuySpy portal is copyrighted junk from Microsoft too.

This is just another chink in the ASP.Net armor.

# re: FlexWiki doesn't get ASP.Net

Thursday, August 18, 2005 4:33 PM by Robbie Coleman
Beautiful!

I clicked on your FlexWiki link in this post and got ASP.NET Runtime Error!
http://www.flexwiki.com/default.aspx/FlexWiki/HomePagea.html

Looks like they did well with error handling as well...

;-}

# re: FlexWiki doesn't get ASP.Net

Sunday, August 21, 2005 3:50 PM by Simon Fell
I had a similar rant about the IBuySpy portal a while back, which was being push as "best practice" i laughed so far i fell on the floor.

# re: FlexWiki doesn't get ASP.Net

Tuesday, June 06, 2006 9:11 PM by forced sex
Wellcome to the real world.

# re: FlexWiki doesn't get ASP.Net

Thursday, June 15, 2006 6:02 PM by rape stories
Need to be readed.

# re: FlexWiki doesn't get ASP.Net

Wednesday, March 28, 2007 2:50 PM by Thomas Hansen

The worst part isn't really writing crappy code, the worst part is to release it with code if your name is "DevelopmentCompanyWithSeveralThousandsOfEmployeesWorthGazillionsOfDollars"...

Microsoft; Get a grip!

You CAN (and mostly do) BETTER!!

# re: FlexWiki doesn't get ASP.Net

Tuesday, June 10, 2008 7:52 AM by Wufdnyaq

Stop! Try to read this interested book:,

# re: FlexWiki doesn't get ASP.Net

Sunday, June 15, 2008 1:41 PM by Dpwljbjg

It's so interesting:,

# re: FlexWiki doesn't get ASP.Net

Wednesday, December 03, 2008 6:07 AM by Asina

<a href= bestpre.com ></a>

# re: FlexWiki doesn't get ASP.Net

Saturday, December 06, 2008 2:37 AM by Semil

<a href= spiritez.com ></a>

# re: FlexWiki doesn't get ASP.Net

Friday, December 26, 2008 8:51 AM by garry-sp

<a href= membres.lycos.fr/dertull >zx10r graphics</a>

# re: FlexWiki doesn't get ASP.Net

Saturday, February 28, 2009 11:59 PM by jyner_fp

<a href= adultpersonalsfinder.com >singles</a>

# re: FlexWiki doesn't get ASP.Net

Sunday, March 01, 2009 12:38 AM by garry-cs

<a href= adultpersonalsfinder.com >singles</a>

# re: FlexWiki doesn't get ASP.Net

Wednesday, April 22, 2009 8:33 PM by Mery-si

<a href= <div align=center><h3>Error. Page cannot be displayed. Please contact service provider for more details.</h3></div> ></a>

# FlexWiki doesn&#39;t get ASP.Net - Followers of the IHttpHandler Hello CMS - the best cms website

Pingback from  FlexWiki doesn&#39;t get ASP.Net - Followers of the IHttpHandler Hello CMS - the best cms website

Leave a Comment

(required) 
(required) 
(optional)
(required)