in

ASP.NET Weblogs

This Blog

Syndication

ASP.NET AJAX Team Blogs

Browse by Tags

All Tags » JavaScript (RSS)
  • Wally’s introduction to 3.5 SP1

    Wally McClure, MVP extraordinaire and ASP Insider, just published a short book about the new features in ASP.NET 3.5 SP1 . It is a short and to the point read that should get you started in no time. I wouldn’t have shown web service access as the main advantage of jQuery myself (the selector and animation support adds more value for ASP.NET Ajax developers) but that’s a minor thing, and there are plenty of other resources to learn about jQuery . Topics in Wally’s book include: Ajax History Script Combining (including ScriptReferenceProfiler) jQuery Routing Entity Framework Dynamic Data ADO.NET Data Services http://www.wrox.com/WileyCDA/WroxTitle/New-Features-in-ASP-NET-3-5-Service-Pack-1.productCd-0470457341.html Read More...
  • Microsoft Ajax Client Templates and declarative jQuery

    Apparently Brian likes our declarative syntax. And jQuery . And he did something quite fun with them, something we had clearly not anticipated: using Microsoft Ajax’s new declarative syntax to call jQuery plug-ins instead of Microsoft Ajax behaviors as was the original intent. < input type ="text" maxlength ="20" size ="40" sys : key =”self” sys : attach =”wajbar” wajbar : submit =”{{ $ ( self ) .next ( ’input : submit’ ) }} ” /> The way he made that possible is by adding a registration step to make the plug-in accessible through sys:attach. This registration API actually creates a wrapper behavior for the plug-in that gets Microsoft Ajax to believe the plug-in is a regular behavior. The actual plug-in gets...
  • Really Simple Testing for JavaScript

    There are plenty of options to test JavaScript code . My goal here is not especially to add to this long list but I needed something for my samples that was brain dead simple to understand and that I could redistribute without any concerns about licensing (this is licensed under the very liberal MS-PL ). I just think it’s good practice to distribute tests with sample code because it promotes TDD and helps to understand the intent of the code. So I built the simplest test framework I could, both in terms of its code and ease of use. The result is very small and at 32 lines of code, it’s small enough that I can post it in its entirety here: // Really Simple Testing for JavaScript // (c) 2008 Bertrand Le Roy, licensed under MS-PL function test...
  • Instantiating components on template markup

    All client-side template engines enable you to create HTML (fell free to go ‘duh’). What they don’t all allow is the creation of event handlers and components over the markup they generate. The general approach with those engines is to do a second pass of code over the markup to create handlers and components. This is quite unfortunate as this generally requires some knowledge of the markup (which plays against separation of concerns) or something like the introduction of marker CSS classes into the markup. For our own template engine, we wanted event handler creation and component instantiation to be first class scenarios, and we wanted both to be possible from imperative code as well as declarative code. Imperative code blocks Let’s start...
  • Getting a reference to a behavior

    In the last post , I showed how you can instantiate multiple behaviors on a single input element, through server extenders or directly through client behaviors (which themselves can be created imperatively or declaratively). In this post, I want to show how to get a reference to these behaviors. Of course, the simplest is to grab that reference when you create the behavior and hold on to it until the next time you need it: var tb1EditInPlace = $create(Bleroy.Sample.EditInPlace, { cssClass: "editInPlace" }, {}, {}, $get( 'tb1' )); Now of course, the code that needs to use a reference might not be from the same source or area of responsibility as the one that created it. If you created the behavior through declarative markup...
  • Putting more than one behavior on one element

    Microsoft Ajax has the interesting ability to combine more than one component onto a single element. In the previous talk, I alluded to this possibility and one of the commenters (Tiamat) asked me to show how this is done. Here is an example that combines the new EditInPlace behavior I showed yesterday with an AutoComplete and a Watermark from the Ajax Control Toolkit: <% @ Page Language ="C#" %> <% @ Register Assembly ="AjaxControlToolkit" Namespace ="AjaxControlToolkit" TagPrefix ="act" %> <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml">...
  • Building a neat edit in place behavior

    For the purposes of my next post, I built a neat little edit in place behavior and I thought it deserved its own post. It does a pretty good job at showing how easy it is to build a clean behavior using ASP.NET Ajax. It’s always good to go back to the basics… In this post, I’ll show you how the behavior works, but more importantly how I built it. The behavior is pretty similar to the in-place editing behavior Nikhil built a while ago (but it works against the latest Ajax framework). It attaches to any text input or text area. In the absence of JavaScript, nothing happens and the input is directly usable, which makes for a graceful degradation story. When JavaScript is enabled, the behavior hides the input and replaces it with a span that has...
  • The magic behind live bindings explained

    Dave has a fantastic and very detailed post about our implementation of the Observer pattern in ASP.NET Ajax 4.0 . This feature is what enables the live bindings to work. Check it out! http://weblogs.asp.net/infinitiesloop/archive/2008/11/09/asp-net-ajax-4-0-observing-updates-to-pojos-plain-ole-javascript-objects.aspx Read More...
  • Building a data driven application with ASP.NET Ajax 4.0 and ADO.NET Data Services

    Jim Wang (one of the great QA people on the Ajax team) just started a blog, and his first post is a very detailed walk through building a data-driven application from scratch using ADO.NET Data Services and the new client templates in ASP.NET Ajax 4.0 . http://weblogs.asp.net/jimwang/archive/2008/11/05/working-with-ado-net-data-services-in-ajax.aspx Read More...
  • PDC 2008 ASP.NET AJAX Futures talk available online

    The full 83 minutes of my PDC talk are available on the Channel 9 web site . You can watch the session online (using Silverlight) or download the video in a number of formats. Slides and source code for the demo are also available. Watch online: http://channel9.msdn.com/pdc2008/PC32/ Download MP4 / iPod , Zune , WMV or WMV-HQ . Slides: http://mschnlnine.vo.llnwd.net/d1/pdc08/PPTX/PC32.pptx Demo code (contains MIT and MS-PL licensed JavaScript files): http://mschnlnine.vo.llnwd.net/d1/pdc08/ZIP/PC32.ZIP Another talk you may be interested in is Stephen Walther's . Stephen did an amazing job explaining how jQuery and ASP.NET Ajax work and fit together. The talk is very accessible even if you have no prior knowledge of jQuery: http://channel9...
More Posts Next page »