WebDotNet is an experiment in web frameworks. Inspired by the python web framework, web.py, it is an exercise in extreme minimalism in a framework in about 250 lines of c#.
What is this framework?
WebDotNet is a minimalist implementation of a web.py
or Google App Engine style framework in c#. The entire framework is around 250 lines of code.
What the project does consist of is a routing mechanism using the built in IRouteHandler functionality in asp.net, a HttpHandler that accepts the defined requests and routes them to the appropriate class, and a few extension methods to form a very rudimentary
Controllers are simply classes that support GET and POST requests, that take the specified parameters defined in the routes as parameters. The first parameter always being the HttpContexBase of the request, so by default, the controllers are very easy to test.
I will put together more documentation on this project on my blog when I can get a few moments. For now, this is how you would create the Hello World project.
First, create an empty asp.net project.
The solution should look like this (Ignore the other sample projects for the moment.):
Add a global.asax for loading the routes on startup.
Add a reference to the WebDotNet framework.
Add the routing to the global.asax file.
Add a standard cs class to the project. (I added a Handlers folder in the project, and inserted the class there.)
And, finally, create the hello world controller.
Then, run the app, and you will see the final result.
In the solution, there is a project that is a port of an extremely simple todo application written for the web.py framework located here
. The solution shows a quick example of how to structure your solution, how to use ajax with the framework, and is backed with a super simple xml data store.
If time permits, I will add more examples and docs either here or on my blog.
This project is insanely simple. And I like simple. As it stands, this project is not a production class implementation, and it probably will never be. I uploaded this project to inspire people to think of different ways to make things simpler. Please do not
focus so much on the examples provided, but the framework, and how vastly different it is from anything else in the .net world.
Is this better than asp.net mvc or fubumvc?
Its not better
than either of those solutions. But, it is different, and it may give you an idea for your next framework that
than those two solutions.
Discussions are welcome.