DNAP — Dot Net And Prototype

I develop a lot of AJAX-y apps, mostly tools, at work.  Most of the time I need a very easy way of hooking up a server side call that returns html and/or an object model, hydrated with data.  I was using AjaxPro but since I also use the prototype javascript library, I've run into problems using both.  There are ways to make them play nice together but that requires config settings, and that's a little annoying to me.  Usually I end up skipping AjaxPro, and just using the built in Ajax.Request class in prototype.  That usually ends with me implementing a simple webhandler that just knows how to handle ajax requests.  The problem with this scenario is it takes time, time that i don't have.  What I need to do, is essentially reference an assembly, write a .NET method and call it from javascript client code, and nothing else.  I don't want to use webhandlers if I don't have to, and I don't want to set up any config settings, and I do not want to add code that registers a type that contains the ajax methods I want to call.  I want the application to do that for me, it needs to just work.

That's where DNAP(pronounced dee-nap) comes in.  It's the glue that connects .NET and client side javascript without completely changing server side code or client side code to enable this ability.  It uses prototype javascript for the ajax calls and Jayrock for JSON serialization of any return value from the server.  That's pretty much it.  You can get the code here.  It's a .NET 1.1 app, but there's nothing magical in there so it works in VS2005 as well.  There is a bare minimum example included and you can view the examples here

 
Author: , 0000-00-00