Ups and down with Microsoft Ajax
I follow the development of Microsoft Ajax aka Atlas since the beginning but I never had the chance until now to write a project using it.
Indeed I wanted a clean new project from scratch and I got the opportunity to build one recently. It's an administration tool, nothing exciting, but useful for a lot of my colleagues.
Far from the shiny demos Microsoft is showing on their site, I can tell my experience has been so far mitigated.
Yes it's a great step for mankind, but we are still far from Mars! It's a good first version, but hopefully the toolkit will be more integrated in the next version of Visual Studio.
Few comments:
- One major drawback is the lack of official documentation.
I bought few books, more or less good, most of them
referring to Atlas and not Microsoft Ajax, so it's difficult
to know if the author include the official release or just
the beta.
Yes of course I found some interesting
resources to help me, but it's really time consuming.
Check this handy page
to get a maximum from all the resources available.
- To go with the previous point, the lack of useful samples.
One example, the Controls extender toolkit is a really
powerful idea, like the animation, the modal popup, etc...
But sadly difficult to cover every possibility quickly
without detailed samples.
Do you know some good samples
let me know!
I have in mind one control I needed
absolutly the Tabs container. This is a fantastic set but so
difficult to get it working.
For instance, a Tab click
don't have any mechanism to trigger directly a server event,
so you have to call a client side script to trigger your
event.
Just for this, three days of hard googling and
research. I would like to get more details about the methods
and properties of each controls.
- The spaghetti code is back with Microsoft Ajax. Yes true
because of the way Microsoft interpret the DOM, it is not
straightforward to access a control value.
Example:
In your page, you have an input box nested in a Tab panel itself in the Tab container. In Javascript if you want to read the value from an Input control, you can't do this anymore:
var InputValue=document.getElementById('MyInput').innerHTML;
instead you do:
var InputValue=document.getElementById('<%=TabName.ClientID%>_MyId').innerHTML;
(see more details in this forum page)
I got stuck also for a while because some of my scripts were not working anymore, so after moving them to the Body section after the ScriptManager tag, everything back well.
So unless you use a Masterpage it's a bit messy to get the scripts outside the Head section in the Body part. Of course I am not a Javascript so maybe I miss something!
- Cross browser support is far from perfect! OK my project
don't need to run with Firefox, but I have some strange
behaviors with some of the controls, like missing tabs or
text rendered outside their divs, etc...
If Firebug is
enabled, it stucks all the time in the Ajax client libraries
on some of the code for no reasons.
So for this reason
I won't recommend using the Ajax toolkit for a public site
without cautious debugging.
- The UpdatePanel is
a great idea but I find myself putting too much of them in a
page. Nothing I can do really there, otherwise some of my
'classic' controls don't work anymore.
So partial
rendering is a great notion, but it has to be implemented in
a better way.
So far even if I have some critics on Microsoft Ajax, I can
say it worth it to have a look if you code a web
administration project.
I never be a big fan of
Ajax libraries, so maybe my point of view is biased, I
prefer to craft some nice Ajax request when I want where I
want.