Dr.NETjes

Dion Olsthoorn on ASP.NET

MagicAjax.NET online demo's !!

So you want to use Ajax to make your webapplications more interactive and better performing, but you don't want the hassle of writing cross-browser JavaScript?
And you also want to keep using the ASP.NET server-side programming model?

Then open-source MagicAjax.NET is the right solution for you!

MagicAjax is easily integrated in your ASP.NET 1.1 and 2.0 webapplications:

  • Step 1: Add the MagicAjax HttpModule in your web.config
  • Step 2: You put the part of your page that you want to have Ajax functionality inside an AjaxPanel (<ajax:ajaxpanel>)

That's all you need to do! The MagicAjax framework takes care all of the intrinsic details for you.

We've put together a few example pages to show the power of MagicAjax.NET. See the online demo on http://demo2.magicajax.net/ (note that the server is sometimes very slow):

You can view the sources of all demo pages online, so you can see for yourself how easy it is to use MagicAjax.
Tip: Also have a look at these MagicAjax demo's using FireFox. Fully supported!

Next you see a screenshot of the WebPart Framework in ASP.NET 2.0 using MagicAjax.NET.
Moving, adding and removing of WebParts is all done without a single visual postback; the WebParts just appear on your page!

Comments

Frans Bouma said:

Let me be the first: Feyenoooohooord!

hehe:P

Looks great though. What I wonder though is: why is everyone forgetting how huge pile of crap Javascript is and especially programming javascript? There's no consistency, and debugging for example is equal to using gdb on a vax100 terminal.
# December 9, 2005 6:49 AM

Gabriel Halsmer said:

Ah, give JScript a chance Frans. :) I love it. And surpisingly in VS2003, debugging JScript is easier then ASP.NET. The .NET debugger occassionally dies on me, but the JScrip debugger never does (the size of our app probably contributes to the flakiness of the .NET debugger). I've added several pages recently to our app, and those I did with JScript were much much quicker. The only problem I see is it's not strongly-typed (no compiler) and no intelli-sense. I'm hoping that's what Atlas is going to address.

Anyway about MagicAjax, its made a huge difference in our application. Now it wasn't an easy "flip-the-switch" installation. Maybe the most recent version has less problems but the original design of keeping the Page object alive and in Session was a tricky affair. It yields phenomal performance but at the same time its quite a departure from the traditional "re-create Page tree each postback". Several places in our app had to take into account things like:


* OnPreRender is not fired, and a control was expecting it.
* Controls are not recreated on each callback. Some of our code was expecting private variables to be reset, or other such side-effects of a newly created control, to occur for each postback.
* When a control is attached to the Page during a callback, it plays catch-up to its last phase OnPreRender. Some of our controls erroneously expected only a certain number of phases to be called when the control was attached
* Some of our controls did not call DataBind after their DataSource was modified. In special situations, our controls could get away with this because they expected the CreateControlHierarchy to be called in the last-stage Render for a normal postback.
* Something in our code was explicitly dependant on the HTML of a postback (e.g. hooking into “__doPostBack”).


All of these could be fixed in our app, but it took well over a week to find them.

Still I want to give the MagicAjax guys credit for a really great tool!!!
# December 9, 2005 5:19 PM

Argiris Kirtzidis said:

Gabriel, the latest release of MagicAjax has a new configuration option that doesn't keep the page object alive and it has the predictable execution cycle of a PostBack (that's the default now btw).

Now it really is a easy "flip-the-switch" installation, or at least we're hoping that it is. :)
# December 10, 2005 6:15 AM

Sonu Kapoor said:

Nice. Well done.!
# December 11, 2005 3:08 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)