Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

[out of date post... this deals with MS Atlas CTP... which has been change drastically and is now MS Ajax Extensions]

I started a post yesterday (and I will complete it) about my experiences wiring up Atlas to a site that has multiple MasterPages (actually the site I’m working on is a portal that dynamically selects the MasterPage based on the URL that is used to hit the site).

I have been noted as an early critic (Ok, I made one post where I thought you had to use Web Services…  I still think the docs are really messed up for leading you to believe that this is true… I’ll post about this once I’ve played with it a little more…).

So I have been playing with Atlas… Ok, I’m more than playing.  I’m using it.  Atlas gives me the one thing that I wanted more than anything.  It’s an extremely concept, but a very hard thing to accomplish well (you can accomplish it, but the “well” part is the trick).

My goals for JAAJAX were very simple.  I wanted an Ajax library that let me put more code on the server.  You might say “what about the GUI widgets?”  To that I say “Padowan (tm), back in the day we were DHTML widgeting all over the place.  It was wonderful… that is until a new version of one of the browsers came out then we were scrambling to fix the issues… new browsers and new standards tended to screw everything up.”   I know you’re saying, “but, but, but… what about the standards… if you stay standards compliant you’ll be ok…”  Again, “We all thought that back in the day too… Where did that get us?  Not only did the standards radically change, but browsers object models radically change (compare the DOM in NS4.7– to NS6+).”  Basically, I don’t trust any of this new GUI stuff.  I’m old school… I try to stick with pure HTML.  Although, I’m not as bad as I’m letting on; I will be playing with some of the widgets and I will be probbaly building a few, but right now I’m taking small steps in that direction (mainly because I got burned in the past).

I love the Atlas UpdatePanel!!!!

Now that I have that out of my system.  Let me explain what it is (if you are someone who has yet to look at it).  I’m sure someone at CodeBetter has talked about it, but maybe not.  Here’s how you use it…

First of all install Atlas.  It won’t hurt your machine I promise.  Also start a new Atlas project (or do like I did and start a new Atlas project so you can copy all the settings to the web.config of an existing project).

Add the following to your page (in between the form tags)…

<form id="form1" runat="server">

<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />

<atlas:UpdatePanel ID="upnlMyLabel" runat="server" Mode="Always" RenderMode="Inline">
<Triggers>
  <atlas:ControlEventTrigger ControlID="btnMyButton" EventName="Click" />
</Triggers>
<ContentTemplate>
 
<asp:Label ID="lblMyLabel" runat="server" Text="" />
</ContentTemplate>
</atlas:UpdatePanel><br />
<asp:Button runat="server" CssClass="contentButton" ID="btnMyButton" Text="Click Me" OnClick="btnMyButton_Click"
</form>

So here’s what happens: when the Button is clicked page will be Atlas Postback’d (which means an Ajax call will occur back to the page firing the standard events including btnMyButton_Click and any changes to the Label will be rendered after the postback will be rendered to the page.  This includes text changes as well as hiding the field (I haven’t tried it, but I bet you could change the font as well) 

You also don’t need the Triggers tag (in the UpdatePanel) at all.  You can simply wrap a section of server side Html that would normally cause postback (like say a dropdownlist with a  SelectedIndexChanged event) and the postback will automagically happen via Ajax on browsers that support it posting the page and calling the event on the server and will update any server controls within the UpdatePanel that change

This is the kicker.  If the browser doesn’t support postback what do you think happens?  You can almost see this coming.  The browser will still cause normal postbacks and you don’t need to do anything with it.  Very cool!  So for “up level browsers” they get a great experience and downlevel browser users are encouraged to upgrade <grin />

[tags: Ajax, Atlas]
Print | posted on Wednesday, April 26, 2006 8:56 PM

Feedback

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 4/26/2006 11:27 PM Gravatar

Heh. btnMyButton.

I can't help but think of Dead Poets Society. Oh Captain, my Captain. :)

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 4/26/2006 11:57 PM Gravatar

Hey... Who let you back in Appleby!  

<grin />

Actually I use Hungarian Notation for controls to make them easier to find (I don't use hungarian for anything else).  But yeah I guess I could have named them btnMy and lblMy, but that doesn't make any sense...

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 4/27/2006 12:32 AM Gravatar

I'm sure it only happened because you were doing sample stuff - that's why i didn't say any more about it.  And you don't have to justify your use of hungarian to me - i still use it too.

I was only pointing out the humour :)

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 4/27/2006 12:43 AM Gravatar

I also use hungarian for controls.  But only so I can easily find and identify controls from other goop.

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 4/27/2006 2:53 AM Gravatar

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 4/27/2006 3:14 AM Gravatar

Thanks, Vikas!  I hope my other Atlas stuff is helpful as well (Right now, I'm tearing apart the client library and posting my notes.. maybe they can stand in the place of docs until MS can publish their docs)

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 4/27/2006 10:55 AM Gravatar

I agree, from what I've seen of the latest Atlas builds the concept is very cool. As soon as they get the code valid, I'll start using it on public sites. In the mean time, I'm only going to use it on intranet apps where the browser is standardized.

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 5/4/2006 6:10 AM Gravatar

hey,

so what happend to the Masterpage-Part of Atlas. U mentioned that you do a lot with Masters; I have real trouble getting Atlas to work on a content page using a masterpage...

Do you have any idea what to watch out for?

CU B

# re: Why Atlas is cool! (AKA Why there will never be another JAAJAX release)

left by at 5/4/2006 12:23 PM Gravatar

Bjoern,

See this post - theruntime.com/.../143641.aspx

BTW, you can also use a ScriptManager in the Masterpage and put a ScriptManagerProxy in your content pages... but the Proxy doesn't appear to give you access to everything...

Title  
Name
Email (never displayed)
Url
Comments   
Please add 6 and 2 and type the answer here: