Atlas declarative blocks

The text/xml-script declarative model is great. I'd just like to see it declared outside of the .aspx file. Semething like an "ajax" behind file.

Imagine:
 Default.aspx
 Default.aspx.cs
 Default.aspx.ajax <-- declarative text/xml-script

Most of the Atlas markup I've seen in demo apps is just control bindings and web service proxy declarations. The contents of the tex/xml-script blocks seem to more resemble a mapping file than ui component instantiation.

This should be possible to do by just setting src attribute on the <SCRIPT> element. e.g.:

<script type="text/xml-script" src="Default.aspx.ajax"></script>

This currently doesnt seem to work. I'm sure its because the content type is mixed up. I know this is nit picky but having the atlas declarative block in the HTML markup feels like putting css or script inline.

This also leads to the possiblity of using a "js" behind where you can do all of your client side declarations with simple javascript calls to the atlas script library. This seems on par with everything else coming out of Microsft. If you like to just write code you can do that. If you like to "declare" things with angle brackets your good to go there as well.

For now its back to experimenting...

P.S. The documentation for the March CTP is soooooo much better.

2 Comments

  • Everything you can do with a declarative XML script block in Atlas can also be done with Javascript code. So one technique would be to store the .js file separately and link to it by just doing a &lt;script src=&quot;&quot;&gt; reference. In which case you'd have the code-behind javascript model you mentioned. :-)



    I believe the plan is to also support the XML script blocks being defined in a separate file as well. I thought this was implemented already -- but will check with folks to see.



    Thanks,



    Scott

  • That sounds great! It may be implemented already and I just screwed up the script declaration. I'll play around with it more and see if I can get it to work.

Comments have been disabled for this content.