ASP.NET AJAX 4.0 CodePlex Preview 1 available

I'm very happy to announce that the first preview for the new Ajax features in ASP.NET just went live. Thanks to everyone who made that happen and thanks to all of you for providing feedback on the Roadmap.

This preview contains preview implementations for the following features:

  • Client-side template rendering
  • Declarative instantiation of behaviors and controls
  • DataView control
  • Markup extensions
  • Bindings

I'll go over those features in more details and provide walkthroughs in the following weeks.

As usual, all feedback is very welcome.


  • Any plans of sample website?

  • Eventually, yes, but we wanted to get the bits into your hands as early as possible.

  • Microsoft ASP.NET Ajax is Spam.

    jQuery is Good.

  • Can't wait to start playing with this!!

  • Finally! It was sooo obvious that most resources went to Silverlight for the last 1-2 years. And because I as an ASP.NET developer want to develop web sites, not Silverlight apps, I was getting really !*%$# about the lack of progress on ASP.NET Ajax.

    Let's see some more controls!

  • I tried using ajax the other day for a simple call back to a web service and update content panel. I'm a pretty good javascript developer and have been using jQuery for a long time, but just thought I'd try the .Net way and see how easy it is.

    I found a pretty good tutorial, but even at the end of it I had no real idea of how all the "magic" happens. .Net automatically inserted a load of rubbish into the page for me to make it all work.

    I think the page was over 100k when it was downloaded and working. I did the same with one line of jQuery and the page was 47k altogether.

    The only use I can see for this is for people who are clueless about javascript programming and have to use VB or C#. If that's the case, then they probably shouldn't be doinc client-side programming anyhow IMO!

  • What was the point of your comment, NirvanaViper? How on earth is MS Ajax "Spam?" It's a technology which incidentally Micrsoft pretty much pioneered, and everyone else has adopted. I don't know JQuery from a hole in the ground, but then I'm happy with my Ajax solution (which isn't MS Ajax)

    Spam is tedious, irrelevant junk - pretty much like you posting. If you don't like it, go elsewhere.

  • Will it be compatible with ASP.NET MVC?

  • NirvanaViper, your comment is spurious and irrational. This post/article is nothing to do with jQuery. Spam is unwanted email, which doesn't fit ASP.NET at all. ASP.NET remains a powerful development paradigm and language used by businesses world-wide. I have supported my family for years wiht my ASP.NET development services.

    The fact that you won't even use your name speaks volumes.

  • @NirvanaViper - Apparently you have no clue what spam is. For a good example, see your last comment...LMAO.

  • I've tried DataView control, but it doesn't work.
    I get error about Sys.UI.Preview.DataView is null. Do I do something wrong?

  • I'm not a user of Ajax at this time, however it is seeming to me that it is becoming a replacement of ASP.NET when almost everything is using Ajax, whether it warrants it or not. Eventually there will be no difference because it will take just as long to wait for all the Ajax updates as it was taking to update just the whole page at the same time with ASP.NET. A litle Ajax is a good thing, there more is better???? I beg to differ.

  • Looks promising!

    @NirvanaViper: I use both ASP.NET Ajax and jQuery and they are both good. Not sure how you can class a script library as spam...but anyway.

  • @Mikael: what we put in the preview is pure client-side script, so it should work just fine with MVC. Actually, the latest MVC preview has JsonResult, which should be a very good fit with the template engine.

    @Daniel: this is a very early preview, and we don't have much documentation ready. Feel free to ping me for questions. The dataview control has an event that gets fired every time a template is instantiated (itemCreated), and the arguments give you access to the dataItem that's being rendered and the templateResult, which enables you to manipulate the generated DOM. Is that what you were asking for?

    @Andrey: did you include the script file to the page? Did you also iclude the Ajax Library?

  • @Andrey: There's a typo in the ReadMe.txt file. The actual class name is Sys.Preview.UI.DataView.

  • @Jason: good catch, thanks. I'm updating the readme.

  • @Jason: Thanks! The error is not occurs again.
    But I get only {{name}} and {{description}} titles on the page, not data from someArray.

  • @Andrey: you can send me your code at bleroy at microsoft, and I'll have a look.

  • @Andrey: This example may help you get started with the DataView:

    There are also a couple suggestions based on my initial impressions, Bertrand.

    Thanks for giving us all early access to this stuff. It looks very promising, so far.

  • Hi, good to see you're acting fast on this. I'd like to see the client server controls. The doc says this will be in a futures release but surely these should be quite trivual to build once the client library is built. If this is being pushed back because it wouldn't be useful for mvc then i don't think that is fair on the majority of your user base who are using web forms.

    Also i'm interested to see how the client data source controls could allow me to do paging, sorting without page refreshing. Currently i've been using UpdatePanels (wrapped around a ListView) as alot of the alternative approaches require too much work. However UpdatePanels don't perform too well when there is lots of data.

  • @jgd12345: nothing is trivial :) and this is not being pushed back, especially not because of MVC (this stuff actually works great with MVC). The data source should be in the next release.

  • Bertand,

    I love the new release, but I have one bit of commentary on the client templates so far. Right now you guys have invented a special syntax that overloads the standard comment syntax with an additional asterisk to denote that it actually is code. Instead of doing this, why not use processing instructions? It's exactly what they were intended for. For example:


    Nothing :(

    This should also make the parsing experience simpler (for runtime and design time) because you can more easily detect the presence of these PIs rather than having to inspect each comment tag.

    Of course the PI target name is up for debate... "aspnet-script" was just a first stab at it. :)


  • @Drew: You currently don't get IntelliSense at all in the blocks, which is way better than completely wrong and obtrusive IntelliSense, which you'd get with processing instructions.
    I don't think a custom tag would work either because they would need to be allowed anywhere in the XHTML markup, which if I'm not mistaken they're not.
    We also considered something along the lines of but that is way too long to type and remember.
    We're not super-happy about using comments but it's our best option apparently.

  • I wrote a post about how to do Master-Datails view with the DataView. I thought I'd put in a manual trackback.

  • Hi Bertrand,

    I'm finally taking some time to dig into the new preview and came up with an initial question.

    With declarative instantiation of controls and behaviors, how do I guarantee that the JS file that contains the client component will be available on the page? Do I assume that the declarative instantiation is used at the page level and that the script file containing my client component will be included as a ScriptReference? If I were rendering a control using Rendercontents and wanted to include a declarative instantiation approach with my component (not sure why I would want to, though), would I still need to implement IScriptControl and provide the ScriptReference in the GetScriptReferences method? Is the usage pattern for the declarative instantiation focused at the Page level vs. the Control level?

    Also, on a different note, I'm getting a bit confused with the different previews. Why wasn't the ScriptReferenceProfiler included in this preview? I've got two separate previews going on to get me the latest and greatest...

  • @JRumerman: The js files have to be included into the page somehow, either as a script reference or a plain script tag. If you want to create a server-side extender for your behaviors, nothing has changed here. You do it the same way as you did before. This release really is pure client-side additions that do not modify the server-side model at all.
    The ScriptReferenceProfiler isn't exactly preview. It's an optional tool that will probably remain a separate download for the foreseeable future.

  • Me again !!

    Actually, for the "Code Blocks" issue, I found why it doesn't work.

    It's the difference between NULL property value and a property typo issue.

    Maybe including a try/catch block in the anonymous template code function could be a nice way to handle that kind of typo issues.

Comments have been disabled for this content.