Archive for the ‘ AJAX’ Category

ASP.NET Password Strength Indicator with jQuery Plugin.

Password strength is a key factor in account security for weeb applications. As developers we all have a basic understanding of what a secure password is but the averge consumer of internet applications doesn’t so adding a visual indicator when your user selectes a password is a great feature.

There are many, many plugins that we could select from to implement this feature I’ve selected this one which makes things very easy.

http://plugins.jquery.com/project/password_strength


<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master"
    AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Scripts/jquery.password_strength.js" type="text/javascript">
    </script>
    <style type="text/css">
    .password_strength {
	    }
    .password_strength_1 {
	    background-color: #fcb6b1;
	    }
    .password_strength_2 {
	    background-color: #fccab1;
	    }
    .password_strength_3 {
	    background-color: #fcfbb1;
	    }
    .password_strength_4 {
	    background-color: #dafcb1;
	    }
    .password_strength_5 {
	    background-color: #bcfcb1;
	    }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>Password Strength</h2>

    <table style="border-spacing: 0px; border-style: none">
      <tbody>
      <tr>
        <td style="text-align: right"><label>User Name:</label></td>
        <td>
           <asp:TextBox ID="username" runat="server" Width="200px"></asp:TextBox>
        </td>
      </tr>
      <tr>
        <td style="text-align: right"><label>Password:</label></td>
        <td>
            <asp:TextBox ID="password" class=password runat="server"
                ClientIDMode="Static" TextMode="Password" Width="200px">
            </asp:TextBox>
        </td>
      </tr>
      </tbody>
    </table>

<script type="text/javascript">
    $('form').attr('autocomplete', 'off');
    $('#password').password_strength();
</script> 

</asp:Content>

In the code above I’ve used in-line CSS and script for the sake of learning simplicity.

The CSS is used by the plugin to set the color that corresponds with the “level” of the password as entered.

The script block starting on line 50 turns autocomplete off for the form (we’re working with a password after all) and applies the password strength functionality to the ASP.NET textbox controll names “password:.

As with all the ASP.NET jQuery work that we’ve been doing, we must set the Client Id Mode to “static” so tha tthe ASP.NET runtime does not modify the client ID of the emitted HTML text box.


You can download a working sample [ HERE]


Replacing the Ajax Contol Toolkit with jQuery – how do you want it ?

Sorry this poll has closed.


ASP.NET AJAX Videos & Tutorials (155)

ASP.NET AJAX Videos


Introduction to ASP.NET Ajax History
Use Script Combining to Improve Performance
Get Started with ASP.NET AJAX
Implement Dynamic Partial-Page Updates with ASP.NET AJAX
Make Client-Side Network Callbacks with ASP.NET AJAX
Add ASP.NET AJAX Features to an Existing App
ASP.NET AJAX Enable an Existing Web Service
Use the ASP.NET AJAX Client Library Controls
Use an ASP.NET AJAX ScriptManagerProxy
Use the RoundedCorners Extender
Use the ASP.NET AJAX Timer Control
Implement the Predictive Fetch Pattern for AJAX
Implement the AJAX Paging Pattern
Implement the Incremental Page Display Pattern
Incremental Page Display Pattern (GET and POST)
Use the UpdateProgress Control
Use the ASP.NET AJAX History Control
Implement the AJAX After Processing Pattern
Update Multiple Regions of a Page with ASP.NET AJAX
Choose Between Methods of AJAX Page Updates
Use Other JavaScript UI Libraries with ASP.NET AJAX
Use the ASP.NET AJAX Profile Services
Debug ASP.NET AJAX Applications Using Visual Studio 2005
Customize Error Handling for the UpdatePanel
Use ASP.NET AJAX Client Templates
Build a Custom ASP.NET AJAX Server Control
Use JavaScript to Refresh an ASP.NET AJAX UpdatePanel
Determine an Asynchronous Postback
Use the Conditional UpdateMode of the UpdatePanel
Persistent Comm Pattern (UpdatePanel)
Localize an ASP.NET AJAX Application
Persistent Comm Pattern (Web Services)
Trigger an UpdatePanel Refresh from a DropDownList
Create an ASP.NET AJAX Extender from Scratch
Custom Server Controls that Work With/Without AJAX
Associate AJAX Client Behavior with a Server Control
Retrieve Values From Server Side AJAX Controls
Techniques for Triggering Updates to Update Panels
Use Cascading Drop Down Control to Access a Database
Implement Infinite Data Patterns in AJAX
Basic ASP.NET Auth in an AJAX Enabled App
Dynamically Change CSS Using the UpdatePanel
Dynamically Add Controls to a Web Page
Set Up Your Development Environment for ASP.NET 3.5
Set Up Your Development Environment for ASP.NET 2.0
Partial Page Updates
UpdatePanel Triggers
Authentication & Profile Application Services
Localization
Web Services
Debugging Capabilities

Read the rest of this entry »

Really Simple AJAX Calls with Microsoft WebMatrix

Modern web pages don’t have to post back to change their presentation to the user.
There are many ways to implement these types of features and ASP.NET Web Pages with Microsoft WebMatrix is no different. 

An AJAX callable service can return results in amy different formats, JSON, POX, Encoded Binary, etc. 

In the case below we’ll implement a “service” in a .CSHTML page and it will return a snippet of HTML markup. 

The calling page looks like this.


@{
Layout = '~/_SiteLayout.cshtml';
Page.Title = 'Welcome to my Web Site!';
}

<br /><br />
<div id='TextDiv'>
    ASP.NET Web Pages make it easy to build powerful .NET
    based applications for the web.
</div>

<p>
<input id='TextInput' type='text' />
<br /><br />
<button id='mybutton'>Make an AJAX request .... </button>
<script type='text/javascript'>
   function show(indata)
    {
    TextDiv.innerHTML = indata;
    }
</script>
<script type='text/javascript' src='xmlhttp.js'></script>
<script type='text/javascript'>
  document.getElementById('mybutton').onclick = function () {
        var d = document.getElementById('TextInput');
        doHttpRequest('Service.cshtml?' + d.value, show);
  }
</script>
</p>

You’ll note that this is a modified version of the Default.cshtml page from the default WebMatrix Starter Site Template.

Line 21 Includes a JavaScript file which contains the plumbing to make an HTTP request from our client side code.

On line 23 we wire a handler for the HTML button’s click event.

On line 24 we get a reference to the text input field where we will retrieve data to send to our service.

Then line 25 calls a JavaScript function doHttpRequest() wich is defined in xmlhttp.js

doHttpRequest(‘Service.cshtml?’ + d.value, show);

Note the two arguments.

  1. “Service.cshtml” is the endpoint to be called. In this case, a simple WebMatrix page (and a QueryString Argument)
  2. A callback function (in our case defined beginning at line 16)

Lets take a look at xmlhttp.js


function doHttpRequest(url, callback_function, return_xml)
{
  var http_request, response, i;

  var activex_ids = [
    'MSXML2.XMLHTTP.3.0',
    'MSXML2.XMLHTTP',
    'Microsoft.XMLHTTP'
  ];

  if (window.XMLHttpRequest)
  {
    // Internet Explorer 7 or greater, Mozilla, Safari, etc.
    http_request = new XMLHttpRequest();
    if (http_request.overrideMimeType)
       {
       http_request.overrideMimeType('text/xml');
       }
   }
   else if (window.ActiveXObject)
   {
    // IE6 and below
    for (i = 0; i &lt; activex_ids.length; i++)
    {
      try
      {
        http_request = new ActiveXObject(activex_ids[i]);
      }
      catch (e)
      {
      // Add error handling here.
      }
    }
  }

  if (!http_request) {
    alert('Current browser does not support http requests.');
    return false;
  }

  http_request.onreadystatechange = function()
  {
    if (http_request.readyState !== 4)
    {
        // Response not ready.
        return;
    }

    if (http_request.status !== 200)
    {
      // Repsponse ready, but not [200] OK
      alert('The request resulted in an error.
           (Code: ' + http_request.status + ')');
      return;
    }

    if (return_xml)
    {
      response = http_request.responseXML;
    }
    else
    {
      response = http_request.responseText;
    }
    // Do Callback
    callback_function(response);
  };

  http_request.open('GET', url, true);
  http_request.send(null);
}

The bulk of the code is plumbing and error handling, making sure we can create the XmlHttpRequest object, which requres a dufferent methodology depending on which browser the code is running in.

In future demos I’ll relly on jQuery for AJAX service calls. Among other advantages, jQuery handles browser differences for us.

The service itself is a sample page I’ll name Service.cshtml

It looks like this:



@{
    var MyOutPut = "";
    if(Request.QueryString[0] != "")
    {
        MyOutPut = Request.QueryString[0] + " Data Recieved";
    }

    @MyOutPut
    @:<strong> >>>>>>> &amp;nbsp;  @DateTime.Now   </strong>
}

Note that, unlike the rest of the pages in our site, this one does NOT use a layout inclusion, nor does it specify a doc tgype, etc.

It doesn’t actually return a page at all but rather a simple, but dynamic, bit of HTML markup.

While there are many more complex ways for code in the browser with code on the server, often that complecity isn’t necessary.

This simple method will get you providing dynamic page updates to you ASP.NET WebMatrix Web Pages.

[ Download a working sample HERE ]


Getting ready to move to a jQuery / WCF based AJAX model.

Over the past several years I’ve developed lots of guidance for ASP.NET Developers adding AJAX functionality to their web applications. [ See HERE ]

Most of that guidance has been primarily for Web Forms developers using The Microsoft AJAX Library and the AJAX Control Toolkit.

While those tools are still perfectly viable choices, I’ve added ASP.NET MVC and ASP.NET Web Matrix to the web development work that I do and the above choices are Web Forms centric.

Even in my “Web Forms” applications, I’m using fewer Server Controls in favor of client side User Interface implementations (like jQueryUI and YUI).

Though this is a very different approach than using Server Controls and is usually a bit more coding, it offers the advantages of very detailed control over the aesthetics and behaviors of my browser based UI and it allows me to reuse my client code across Web Forms, ASP.NET MVC, and WebMatrix.

In addition to evolving the client side implementation of my AJAX work, I’m going to be moving from ASMX for services to WCF.

[ Note: I’m going to be doing many videos and tutorials using this model over the coming months. ]

ASMX works fine, but there are many advantages to WCF.

I’ll be blogging specifically about the reasons I’m migrating to WCF in a near future blog post but in the meantime I wanted to introduce you to a CodePlex project that I will be using going forward.

The stiff is being built by the .NET Developer Platform Team so the work here will be reflected in the .NET Stack in the future.

Check them out here – http://wcf.codeplex.com/

Application

WCF Support for jQuery 10.10.27WCF Support for jQuery – create WCF web services that are easy to consume from JavaScript clients, in particular jQuery.

Source Code

WEB HTTP Preview 1.zip – WCF HTTP – create HTTP / REST based web services.

And stay tuned……….

 

Technorati Tags: ,,,

Updating AJAX Patterns How-Do-I Videos.

Below is a list of AJAX Patterns videos that I did some time back.

Implement the Predictive Fetch Pattern for AJAX

25 minutes

Implement the AJAX Paging Pattern

27 minutes

Implement the Incremental Page Display Pattern

12 minutes

Incremental Page Display Pattern (GET and POST)

20 minutes

Implement the AJAX After Processing Pattern

6 minutes

Persistent Comm Pattern (UpdatePanel)

12 minutes

Persistent Comm Pattern (Web Services)

17 minutes

Implement Infinite Data Patterns in AJAX

19 minutes

These videos all rely on Microsoft ASP.NET AJAX and, in some cases the AJAX Control Toolkit

More and more we are moving to a jQuery centric model of development where JavaScript work is concerned and so I think it’s a good idea for me to revisit these patterns with a focus on implementation using jQuery.

Can you list some other AJAX “Patterns” that I should add to the collection ?

THANKS !

PHP for the Microsoft AJAX Library – new Release!

Christian Wenz has pushed a new release of he PHP libraries for the Microsoft AJAX libraries with support version 3.5.

Get it here on Codeplex http://www.codeplex.com/phpmsajax

Free AJAX Data Controls.

The Slackers have been busy !

Check out the Open Source project on CodePlex.

http://www.codeplex.com/AjaxDataControls/

Not only is there a controls library and all the source code for the controls but a RICH set of demos that illustrate utilization.

I’m now using them in my own projects.

Check ‘em out !

ASP.NET AJAX 4.0 CodePlex Preview 1 available

We’re very happy to announce that the first preview for the new Ajax features in ASP.NET just went live.

For more information check out 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 work on videos to cover the new features !

As usual, all feedback is very welcome.

http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=15511

Ajax Data Controls from DotNetSlackers

logo.png
 
This looked interesting so I thought I would share it.

Please let me know what you think…..

From the CodePlex Description.

The Ajax Data Controls is a DotNetSlackers project. Developed on top of Asp.net Ajax Extension, the main goal of this project is to provide rich set of data controls for Client Centric Development Model. Since the data controls of Asp.net like GridView, DataList, Repeater etc does not have any Client Side Object Model thus it is not possible to work with these controls with Web Service / Page Methods call. The included controls exposes same API in the client side as the Asp.net version with few more enhancements. Currently the project contains the following controls:

  • Repeater
  • GridView
  • DataList
  • Pager

http://www.codeplex.com/AjaxDataControls

BOOK: Microsoft AJAX Library Essentials

This is another one of those “Sniper Topics” that I like, again from PAKT Publishing.

Approximately 280 pages of drill down on Object Oriented Client Side development in JavaScript using the Microsoft AJAX Client Libraries.

Not only does this text enumerates the namespaces in the Microsoft AJAX Client Libraries, and provide good coverage of the Client Component Framework, but it teaches all the “whys” along with the “How Tos”.

If your building AJAX applications and Microsoft’s AJAX technology is at the center of your work then this book is a “must read”.

Click on the book image above to check it out on Amazon.com

BOOK: Advanced ASP.NET AJAX Server Controls: For .NET 3.5

I frequently am asked to server as a technical reviewer on development books. Time doesn’t permit me to always say yes but I try to make time to agree to do the more interesting titles.

This book is one I said yes to. Adam and Joel have done a great job of exposing this detailed subject.

Controls are such a powerful re-use mechanism and so under covered.

The book is due for release on July 15th and you can save 5% with an Amazon.com preorder.

[ Click HERE for the book on Amazon.com ]

Multiple UpdatePanels – Who caused the update ?

Does your client code need to know what control caused your update panels to update or which of several UpdatePanels contained the triggering control ? Try this…. (Or do the same thing with addbeginRequest();

    1 <script type=”text/javascript”>
    2 <!–
    3 var prm = Sys.WebForms.PageRequestManager.getInstance();
    4
    5 prm.add_endRequest(EndRequest);
    7 function EndRequest(sender,args)
    8     {
    9     alert(sender._postBackSettings.panelID + ” -> “ + sender._postBackSettings.sourceElement.id);
   10     }
   11  –>
   12 </script>

 Note that “id” contains the id of the CONTROL that caused the postback. panelId contains a string that appends the event trigger with the UpdatePanel name.   Note that if the update was caused by an event configured in the Triggers Collection or updated explicitly in JavaScript, the “Control” name will be the UpdatePanel.

2 New AJAX How-Do-I Videos Now Available

#71 | How To Dynamically Change CSS Using the ASP.NET AJAX UpdatePanel

#72 | How To Dynamically Add Controls to a Web Page (and not have them disappear when you post-back)

AJAX UpdatePanel – "Statefull" Control Update Trigger

I get an obscene amount of email. Since I’ve been working with the Developer Community at Microsoft for 7 years, my email address has been spread around a bit. I get about 1000 email a day. Very often from developers who what me to write code for them :)

I generally don’t have time to do that, but sometimes I get an email from someone why has really tried to solve a problem that should be simple, but whose answer is not always as obvious as the problem would lead you to believe.

This week a Developer emailed me about updating an UpdatePanel.

One of the true strengths of ASP.NET is the ability to take several different approaches to writing applications based on your needs and preferred development style.

Though I think the UpdatePanel control is AWESOME, my personal preference for AJAX style programming leads me to write more client side code and communicate with the server via JavaScript enabled web service calls.

The problem was, the developer was using the UpdatePanel and, due to functionality in the business layer, he needed to prevent the user from click a submit button twice in a row. Meaning, when the user clicks the button that caused the UpdatePanel to update, he needed that buttonto be disabled until the UpdatePanel’s refresh was complete.

So, the UpdatePanel definition looks like this.  

   22         <div>

   23             <asp:UpdatePanel ID=”UpdatePanel1″ runat=”server”>

   24                 <ContentTemplate>

   25                     <asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox>

   26                     <br />

   27                     <br />

   28                     <asp:Label ID=”Label1″ runat=”server” Text=”Label” Width=”622px”></asp:Label><br />

   29                     <br />

   30                 </ContentTemplate>

   31             </asp:UpdatePanel>

   32         </div>

   33         <br />

   34         <input id=”SubButton” style=”width: 618px” type=”button” value=”Call UpdatePanel Method” onclick=”return SubButton_onclick()” />

   35         <br />

   36         <br />

 

Note that the HTML button control “SubButton” is outside the UpdatePanel and is not defined as a Trigger to the UpdatePanel.

 

In order to turn the Button off and get the UpdatePanel to update, we’re going to do it all in JavaScript.

If you use an ASP.NET Button control and disable the Button with an OnClientClick event handler, that code fires first and the postback never occurs.

 

Our JavaScript “SubButton_onclick()” function looks like this.

 

    4 <script type=”text/javascript”>

    5 <!–

    6 function SubButton_onclick()

    7 {

    8     var prm = Sys.WebForms.PageRequestManager.getInstance();

    9     var mybutton = document.getElementById(‘SubButton’)

   10     mybutton.disabled = true;

   11     prm._doPostBack(‘UpdatePanel1′, );

   12 }

   13 // –>

   14 </script>

 

Hopefully the code is self explanatory. 

 

The Button is disabled and the UpdatePanel postback is triggered.

 

But…. How do we know when the update is complete so we can re-enable the Button.

 

 

   37 <script type=”text/javascript”>

   38 <!–

   39 var prm = Sys.WebForms.PageRequestManager.getInstance();

   40 

   41 prm.add_endRequest(EndRequest);

   42 

   43 function EndRequest(sender,args)

   44     {

   45     var mybutton = document.getElementById(‘SubButton’);              

   46     mybutton.disabled = false;

   47     }

   48  –>

   49 </script>

 

Luckily, the PageRequestManager is throughly evented. :)  

 

We just add an “EndRequest” event handler and have it re-enable the Button.

 

Pretty simple after you see the solution :)

 

[ Download the code HERE. ]

 

2 New AJAX How-Do-I Videos Released

Here is the latest in my AJAX How-Do-I Video Series

Hope you like them !

How Do I: Retrieve Values From Server Side AJAX Controls

How Do I: The AJAX Toolkit Reorder Control

RIAnimation – Cool Free ASP.NET AJAX Control

From the HushHushMedia.com web site….

RIAnimation = Rich Interactive Animation

Give your ASP.NET projects new life with RIAnimation. We have taken powerful JavaScript libraries (Prototype, JQuery and Interface) and developed a simple ASP.NET control for applying RIAnimations (Rich Interactive Animations) to any ASP.NET control. With RIAnimation, adding sophisticated interaction to your existing web apps is as easy as dropping our control on the form and setting three properties!

[Click here for more info]

ASP.NET AJAX at AJAX World 2008

 I’ll be joining the fine folks at AJAX World again this year and giving the following talks.

ASP.NET AJAX Design & Development Patterns

AJAX is not about Eye Candy. AJAX is about building functionality that is difficult or impossible with conventional web development technology. Done right your web applications ROCK, but it it’s done wrong and your infrastructure pays the price. This session will expose a collection of design and usage patterns that will help you understand ASP.NET AJAX under the covers and design efficient, interactive AJAX Applications using Microsoft ASP.NET AJAX Technologies.

http://ajax.sys-con.com/read/483595.htm

The Digital Black Belt’s Guide to Building Secure ASP.NET AJAX Applications

You think your ASP.NET AJAX application is secure, but how do you know? Are you SURE? Would you bet your career on it?

Secure application design is 1/3 Architecture, 1/3 Code, and 1/3 Operations. You can’t retro-fit a secure architecture. In this Digital Black Belt crash session you’ll get a whirlwind tour of how to write secure web applications with ASP.NET AJAX. You can’t learn it all in a day, but you can get started with secure development techniques and learn what questions you need to be asking each day in your development process.

Speaker Bio: Joe Stagner is a senior program manager in Microsoft Corporation’s Developer Tools and Platform Group and has been with Microsoft since 2001 focusing on highly scalable and performant Web application architectures, multiplatform interoperability and software security. Stagner brings 30 years technical and business strategy experience to Microsoft which affords him a unique experiential perspective.

http://ajax.sys-con.com/read/483596.htm

I Love NY !!!

Hope you will come say hello !

You can contribute to the ASP.NET AJAX Control Toolkit

Did you know that there is an open contribution model for submitting new controls in the AJAX Control Toolkit ?

This document provides some guidelines on how you could get your custom ASP.NET AJAX control added to the toolkit and therefore used by developers around the world !

The document also contains pointers on how to submit fixes and feature additions for existing controls.

Contributing to the Toolkit

The AJAX Control Toolkit is a shared source project released under the Microsoft Permissive License and built on top of ASP.NET AJAX. It has a set of over 35 controls, many of which were written by members of the ASP.NET AJAX community. The Toolkit has matured into a stable and feature complete product through work with the community over the past year. We would like to continue our organic growth by defining a process for all Toolkit contributions.
Contributions should add sound value to the Toolkit and serve its customers’ needs. Anyone wishing to contribute should be committed to a high quality bar and take responsibility for their code. There are two ways that our users can contribute to the Toolkit: use the Toolkit Patch Utility for bug fixes and new features for existing controls, or become a Toolkit contributor by adding new controls.

If you already have a great control and would like to share it with us or if you would like to write a new control from scratch this is a great opportunity to challenge yourself to write great reusable controls, show-off your technical and design skills, get plenty of visibility, learn more about Shared Source at Microsoft.

If your control goes into the AJAX Control Toolkit – email me, I’ll do a video about it !

Is Microsoft Committed to AJAX ?

I got this recently in an email from a developer friend.

“Is Microsoft committed to Ajax? If so, why is development so slow? (Yeah I know, Silverlight, that means nothing until it is at least version 2 and wide spread.) I am seriously disappointed, and I think others are too. After the 1.0 excitement, there is nothing to get excited about. (What’s up with ASP.NET Futures anyway, how about right now?)”

I guess that it’s hard to keep up with all the new stuff in our profession, so I thought I would hi-light some of the new AJAX related stuff that we’ve been building, especially in ASP.NET 3.5 and Visual Studio 2008 (currently in Beta) as an illustration our investments in AJAX enabling technologies.   

* Core Integration of ASP.NET AJAX – ASP.NET AJAX is no longer an add-on to ASP.NET. It is now a first class concept like XML Web Services or Data Access. This means full support, full feature lifecycle, etc.

* Full and Dynamic JavaScript Intellisense support in Visual Studio 2008. This includes the JavaScript language and all the ASP.NET AJAX Extensions as well as dynamic support for the code that you write.

* First Class JavaScript Debugging Support in Visual Studio 2008, complete with Break Points, Watch, Immediates, Call Stack, everything you would expect from a first class debugger PLUS, both design time and run time code images so you can drill down into your applications exact JavaScript state and collection at runtime no matter how much dynamic JavaScript is involved in your application.

* JSON, RSS, and POX support for WCF so that all your WCF services can me AJAX Callable.

* The AJAX Controls Toolkit has grown to 34 controls.

* 64 ASP.NET AJAX  How Do I Videos offering tutorial and prescriptive guidance on how to use the features of ASP.NET AJAX

* Forthcoming soon….new ASP.NET AJAX controls like the history control, selector support, and other improvements on both the client and server side.

To me that seems like allot of work in a fairly short time (since ASP.NET AJAX 1.0 was released.)

What’s with the “Futures” ???

The current “Futures” include ….

* History support for the Safari browser, inclusion of “titles”, encoding and encrypting of server-side history state and the ability to handle history in the client without a server requirement.

* CSS Selectors APIs have been modified to be applicable to W3C recommendations.

* A script resource extraction tool that allows you to create script files on disk that originate from embedded resources in assemblies.

The reason the Futures are not “Right Now” is simple.

Developers have asked to be more involved in defining the end products we create. “Futures” releases gives folks the chance to get their hands on VERY early bits of the new stuff that we’re working on, and that means you can provide feedback early enough in the process to effect the final outcome.

Most folks tell me that they LOVE the fact that we’re being so transparent in much of our development process.

So in short – YES :) We’re very serious about AJAX !

DotNetSlackers – Ajax Data Controls

DotNetSlackers has just released Ajax Data Controls (ADC) as open source. The project is hosted at codeplex and there are several live examples which can be seen at the samples link below. 

The ADC contains an AjaxGridView, AjaxDataList, AjaxRepeater and we are going to add more controls very soon as well.

To get a feel for them, check out the samples page. Very cool stuff by “TheSlackers” !

 

Are you making these 3 common ASP.NET AJAX mistakes?

Check out Dave Wards advice on Update Panels and Postabacks at Encosia HERE.

http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/

AJAX Style Image Cropper

Cropper_thumb

This cool JavaScript image cropper came through my inbox this week.

Check it out – easily integrated with MS AJAX and the ACT.

http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous

Microsoft appointed to OpenAJAX Steering Committee

During the week of October 1-5, the members of OpenAjax Alliance voted to fill three open slots in their seven-person Steering Committee. The members elected Microsoft, Nexaweb and TIBCO, who will serve two-year terms (from Oct 2007 to Oct 2009). Nexaweb and TIBCO were incumbents. Microsoft joins the Steering Committee for the first time. Many thanks to them for volunteering their services to the community. These three companies join Dojo Foundation, Eclipse Foundation and IBM, whose terms last until Oct 2008.

http://www.openajax.org/blogs/?p=41

Another Cool ASP.NET AJAX InLineEdit Label Control

Check out ANOTHER cool ASP.NET InLineEdit AJAX Control.

http://encosia.com/index.php/2007/08/23/seamless-inline-text-editing-with-aspnet-ajax/

http://encosia.com/index.php/downloads/inline-edit-box-net/

Bilal’s Cool ASP.NET AJAX InLineEdit Label Control

Check out this cool ASP.NET InLineEdit AJAX Control that Bilal Haidar recently released.

http://bhaidar.net/cs/archive/2007/10/03/asp-net-2-0-ajax-inlineeditlabel-control.aspx

Search Engine Optimization (SEO) for AJAX & Silverlight Apps

First of all, if Nikhil Kothari’s Bog is not on your short list – you should add it today !

Secondly – One of my several research topics this fall is SEO (I’m working on growing the www.asp.net community)

Nikhil (who is just a really smart guy to begin with) wrote this interesting blog post on the subject.

You can read it here:

http://www.nikhilk.net/AjaxSEO.aspx

ASP.NET AJAX in Action – Download Excerpts

ASPNETAjaxInAction

If you’re an ASP.NET Developer – you MUST get this book.

It’s simply one of the best Tech Books I’ve read and a GREAT tutorial on MS AJAX.

(And forwarded by ScottGu & Bertrand Le Roy no less !)

I’ll be publishing sample from the book here over the next several weeks.

Down this one to get started.

MS-Word

Microsoft Passes OpenAjax Alliance Interop Tests

A number of folks at Microsoft like Bertrand Le Roy have been working for some time to insure interop with our AJAX technologies.

Read about their successes here.

http://www.eweek.com/article2/0,1895,2187997,00.asp

http://www.eweek.com/article2/0,1895,2105689,00.asp

Resources from my AJAX World Talks

Thanks to everyone who attended my Keynot and breakout sessions at AJAX World and for all the kind worlds.

As promised, here are all th epowerpoint.

Keynote: AJAX In the Ballance.

http://www.joeon.net/downloads/AJAX_In_the_Balance.zip

Breakout: Doing AJAX with the Microsoft AJAX Development Platform  

http://www.joeon.net/downloads/MS_AJAX_2007.zip

Breakout: Microsoft AJAX Programming on the Client

http://www.joeon.net/downloads/MS_AJAX_Client_Dev.zip

ASP.NET AJAX Shorthand Syntax

 

Did you know that ASP.NET AJAX include these shorthand notations for commonly used commands ?

$

get(‘YourControlName’)

Shortcut to Sys.UI.DomElement.getElementById – gets a reference to the DOM element, same as document.getElementById

 

$find(

) 

Shortcut to Sys.Application.findComponent

$create() 

Shortcut to Sys.Application.Component.create

$addHandler(FormElement, EventName, HandlerMethod) 

Shortcut to Sys.UI.DomEvent.addHandler

 $clearHandlers(FormElement) 

Shortcut to Sys.UI.DomEvent.clearHandlers

 $removeHandler(FormElement) 

Shortcut to Sys.UI.DomEvent.removeHandler

ASP.NET AJAX Postback Event Validation

In my video “How Do I Use the Cascading Drop Down Control Extender”  I demonstrate setting EnableEventValidation=”false” at the page level and mention that you can leave the default (which is true) and individually authorize client event.

Since I’ve had a number of email about this, I thought I’d comment on the issue here.

It turns out that it’s actually a bit tricky in the case of using the Cascading Drop Down Control Extender when the Drop-Down values are dynamic. (Meaning they come from a data-source where items might be added after your code is written.)

The reason is that you need to SPECIFY what values are valid for the post-back.

Example, in the Render or Pre-Render methods you could:

   ClientScript.RegisterForEventValidation( _MyList.SomeUniqueID, “Red”);

   ClientScript.RegisterForEventValidation( _MyList.SomeUniqueID, “Green”); 

   ClientScript.RegisterForEventValidation( _MyList.SomeUniqueID, “Blue”);

The issue here is the “Red”, “Green” etc.

Of course, you could pull them from the database at runtime and call RegisterForEventValidation for each value.

Rather than write about all the details I’ll point you to a pair of excellent blog postings by K. Scott Allen over at OdeToCode.com

Read HERE: http://odetocode.com/Blogs/scott/archive/2006/03/20/3145.aspx

And HERE: http://odetocode.com/Blogs/scott/archive/2006/03/21/3153.aspx

Thanks Scott! Good stuff !

My JSON Editor

No, not MINE, actually Thomas Frank’s.

After searching and not finding a JSON Editor that met his needs, he wrote his own called “My JSON Editor”.

Ceck it out here: http://www.thomasfrank.se/json_editor.html

Tags:

Force an UpdatePanel Update from JavaScript

The ASP.NET AJAX UpdatePanel gets updated in one of 3 ways.

1.) An implicit control event triggers an update (that is a control inside the UpdatePanel is getting updated, etc.)

2.) The UpdatePanel has a <Triggers> Collection, and one of the defined triggers gets fired.

3.) The UpdatePanel’s Update metod is explicitly called in the course of some server side logic.

BUT…….  What if I want to explicity trigger an update to the UpdatePanel from my client side JavaScript code ???

Ceck out his link on CodeProject for a solution.

http://www.codeproject.com/useritems/UpdatePanelScriptExtender.asp

A complete list of Ajax Libraries, Frameworks and Toolkits

I’ve compiled a nearly complete list of Ajax Frameworks and Libraries. I intend to test as many as I can and post the results here. (I’ll test the commercial one I can get a license for.) If I missed any, if you have any suggestions, or you work on any of these projects – please feel free to email me via the contact form.

AccessKey Active Widgets Aflax
Ajax AC Ajax CFC AJAX Engine
Ajax Tags AJAX.net AjaxAnywhere
AjaxGear Toolkit AjaxRequest AJForm
AJS ANAA Anthem.NET
APHPLix Aspects aSSL
Authentico Backbase Bajax
Behaviour Bindows CakePHP
Crossvision Dojo DOMApi
DPSyntax Hilighter DWR Echo2
Engine Flash Object Flexible Ajax
Fresh Logc Gaia Widgets Google – GWT
HTML_AJAX IWF JackBe
Java BluePrints Jquery Jsan
JSON-RPG-Java JSPan JSPkg
JTQJSPaging JWic Laszlo
LibXMLRequest Microsoft Ajax Mochikit
Moo Ajax Moo.fx Nexaweb
Nifty Corners Nitobi Overlib
PAJAJ Pajax PHP-JSON
PlexTk Protptype qForms
Qooxdoo Rialto Rich Web Client
Rico / Open Rico RSLite SACK
Sajax Sardalya Sarissa
ScriptCoreLib Sarmal Scriptaculus
SmartClient Solvent Spry – Adobe
Symfony Taconite Tacos
ThinWire ThyApp Tibco General Interface
Toxic TurboGears Visual Web GUI
WebORB WebWork WZ_DragDrop
WZ_jsGraphics X Xajax
XHConn XHRConnection XOAD
Xwire Yahoo – YUI Zephyr
Zimbra ZK Zoop

Click here for the detailed list with links to each, license type, and basic technology !!

A comparison of AJAX Libraries & Frameworks

I’m working on a compariosn of AJAX libraries and frameworks.

Is there any other that you care about that’s not in this list. 

Please comment with other libraries, or if you use one of these, what you like and don’t like about them.

THANSK !

Microsoft Ajax – http://ajax.asp.net

 

Java BluePrints – https://blueprints.dev.java.net/

 

Protptype – http://www.prototypejs.org/

 

Scriptaculus – http://script.aculo.us/

 

Laszlo – http://www.openlaszlo.org/

 

GWT – http://code.google.com/webtoolkit/

 

AJAX.net – http://www.ajaxpro.info/

 

Yahoo – http://developer.yahoo.com/yui/

 

Active Widgets – http://www.activewidgets.com/

 

Tibco General Interface – http://developer.tibco.com/

 

Visual Web GUI – http://www.visualwebgui.com/

 

Dojo – http://dojotoolkit.org/

 

Backbase – http://www.backbase.com/

 

SmartClient – http://www.smartclient.com/

 

Nitobi – http://www.nitobi.com/

 

JackBe – http://www.jackbe.com

 

Zimbra – http://www.zimbra.com/

 

Rico – http://www.openrico.org/

 

Spry – http://labs.adobe.com/technologies/spry/

 

Aflax – http://www.aflax.org/

 

DWR – http://getahead.org/dwr

 

Moo.fx – http://moofx.mad4milk.net/

 

Mochikit – http://www.mochikit.com/

 

Xajax – http://www.xajaxproject.org/

 

Nexaweb – http://www.nexaweb.com

AJAX Webcast Series

Rob Bagby – a Developer Evangelist here at Microsoft – has scheduled a series of webcasts on MS AJAX. Tune in with me !!!!

 

ASP.NET AJAX Client Libraries: Calling Web Services (5/3 @1:00 p.m. Arizona time) http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032337914&Culture=en-US

 

ASP.NET AJAX Client Libraries: Object-Oriented Development (5/15 @9:00 a.m. Arizona time) http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032337930&Culture=en-US

 

ASP.NET AJAX Client Libraries: Creating Controls (5/17 @9:00 a.m. Arizona time) http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032337935&Culture=en-US

 

ASP.NET AJAX Client Libraries: Creating Behaviors and Extenders (5/21 @10:00 a.m. Arizona time) http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032337940&Culture=en-US

 

ASP.NET AJAX Client Libraries: Development Tips and Tricks (5/28 @10:00 a.m. Arizona time) http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032337951&Culture=en-US

 

ASP.NET AJAX Client Libraries: Session Review (5/28 @10:00 a.m. Arizona time) http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032337956&Culture=en-US

AJAX Grid and Slider Navigation

Every day a few folks send be pages of code and ask be to make it work for them (No Kidding)

Joshua Folkets is a developer that I had dialog with in the past and this we we sent me code for me to USE rather han fix.

What a treat – he just sent to me and said “I thought I’d send you this in case you find someone who might use it.”

And here is a link to the code (use at your own risk) …..

http://www.joeon.net/downloads/SliderGrid.zip

Joshua – You ROCK !

JSON Hijacking and the National Enquirer

A couple of days ago eWeek posted a panic attack here http://www.eweek.com/article2/0,1895,2110554,00.asp?kc=EWEWEMNL040307EP37A that sensationalized a paper that Fortify published here: http://www.fortifysoftware.com/advisory.jsp

I posted a link to the article yesterday – sort of tung in cheek, but decided to wait until I could refer to more information because folks might not intuit my point.

So let me offer this subtle hint: THERE IS NOTHING NEW HERE !

Security companies market themselves by generating press about their research – fair enough.

Tech Media Companies like eWeek naturally sensationalize to keep their readership flowing (the National Enquirer model of Journalism).

Now, it’s not like I don’t take developer security seriously. I spent about 4 of the past 6 years focused mostly on developer security.

But it’s time we fix the perspective a but. Fortify wants to identify the AJAX venders as the source of these security problems. (And not just Microsoft but basically everyone that makes Ajax Software.)

It’s great that security companies are looking at the rapid adoption of Ajax and calling attention to security issues. But, at the risk of sounding redundant …

THERE IS NOTHING NEW HERE !

HTTP & JavaScript have not changed. The possible programming mistakes have not changed. The defensive development practices that mitigate these risks have not changed. Just some of the buzzwords have been added.

ScottGu has replied here to some of the specific call outs in the above referenced article : http://weblogs.asp.net/scottgu/archive/2007/04/04/json-hijacking-and-how-asp-net-ajax-1-0-mitigates-these-attacks.aspx

Since it seems like there are still a good number of developers that are not yet up to speed on Web Development security and are particularly interested in how these security challenges relate to doing Ajax style programming…….

I’ve been talking to my old security buddy Mark Brown about resurrecting the “Digital Black Belt” Secure Development Series to do an extended “Developing Secure Web Applications with ASP.NET and Microsoft Ajax”.

Please offer your opinions so that I can gage interest.

Joe

This week at Ajax World

It’s conference season.

Last week I was at the PHP Quebec conference.

http://conf.phpquebec.com/

This week ………

I’m in New York City this week speaking at Ajax World.

Just being here and staying at the beautiful Roosevelt Hotel at 45th & Madison has been a fun blast from the past. I worked in Manhattan for five years.

I’ve run into a number of old friends and coworkers, and, even though I’m pretty over committed these days at work and have spent much of the conference in my hotel room working, I’ve managed to tour the expo floor, meet with many of the vendors and get a look at their products, talk to lots of customers at the Microsoft booth, and attend some interesting sessions.

There are about 1000 people here and there have been a few revelations.

1.) Ajax is even hotter than I thought.

2.) There is HUGE interest from large enterprises, venture capital firms, and the like.

3.) There is still lack of understanding about what Ajax means to application design and architecture and User Experience.

4.) Most people STILL don’t know Microsoft offers great FREE Developer Tools !

Get Yours Here : http://msdn.microsoft.com/vstudio/express/

Next week ………

I’m presenting on AJAX at the Microsoft Technology Summit on the campus in Redmond and spending a couple of days meeting with the dev tools and platforms product units to discuss some really interesting new resources for developers.

Stay tuned !

WEBCAST TODAY- AJAX Security Best Practices

Today at 9:00 AM PST / 12:00 Noon EST

Today is the final installment of the AJAX Security Webcasts.

You can still attend TODAY.

CLICK HERE TO ATTEND !

ASP.NET AJAX in Action Book

Alessandro “Garbin” Gallo, David Barkol, and Rama Krishna Vavilala have been working on a great ASP.NET AJAX 1.0 book for Manning called “ASP.NET AJAX in Action“:

Early chapters are now available online via their early access program.  Click here to learn more and start reading it today.

You can watch all of the videos online for free at: http://www.asp.net/learn/videos/ (also make sure to check out the more than 50+ other videos on that page as well).

I am now working on a NEW series – “AJAX Patterns with the ASP.NET AJAX Extensions”.

MS AJAX DOCS: Download the off-line version

MS AJAX : Get thhe Off-Line Version of the Docs HERE.

ASP.NET AJAX 1.0 Source Code Released

Read about it here…..

ScottGu’s Blog : ASP.NET AJAX 1.0 Source Code Released.

MS AJAXDOCS: Download the off-line version

MS AJAX : Get thhe Off-Line Version of the Docs HERE.

MS AJAX – Page Methods stop working with RTM Version ?

Set  EnablePageMethods=true on your ScriptManager.

 

Page method proxies are no longer created by default.

CollapsePanel Extender FLASHING on Page Load ?

This was really bugging me and I guess others as well.

In the forums they thought it was a bug in IE6 (http://forums.asp.net/thread/1488886.aspx), but I was getting the same behavior in IE6, and Firefox

Setting the Height in the content panel (the collapsable area) to 0 solved the problem for me in IE and Firefox.

<asp:Panel ID=”ContentPanel” runat=”server”

     CssClass=”collapsePanel” Height=”0″>

 

Anyone who still has IE6 installed, let me kow if you still get the panel “flash” on page load.

Introduction to the PopupControl Extender

Check out this cool article by Brian Mains.

In addition to the titles topic it contains a good description of extender controls.

Introduction to the PopupControl Extender.

MS AJAX Release Version-element [Anything AJAX] is not a known element.

Earlier this week I was re-writing Scott Guthrie’s ToDo List Atlas demo to work with the release version of MS AJAX and hit an ugly snag.

When using a master page (and ONLY when using a master page, the use of some AJAX controls produced the relatively useless [unknown element] error.

I searched and searched (I even tried Goggle) and found similar issues with Beta and RC versions of MS AJAX but I was using the latest bits and the solutions for the old versions were to use the ATLAS prefix. (A kludge.)

After doing my research I phoned ScottGu (Father of ASP.NET who hired me). It was about 10:00PM EST and Scott is commonly in the office in the evening.

Scott wasn’t in the office, but he “knows everything” so even though I didn’t ;leave a message he phoned me back about 15 minutes later.

I described my problem and, of course he had the answer off the top of his head.

1.) This is only an issue when you have been using an older CTP or Beta version of MS ATLAS and then updated to release bits.

2.) It happens because the schema that intellesence is cached on a per user basis so un-installers can’t really figure out what to un-install in this case because cache locations are not determined by the installer.

3.) HALF of the fix includes installing Service Pack 1 for Visual Studio 2005 / Visual Express

4.) The other half is to explicitly flush the Intellesence cache like this….

- With Windows XP you do this by deleting all files in this directory: c:\Document and Settings\[YourUserName]\Application Data\Microsoft\VisualStudio\8.0\ReflectedSchemas

- With Windows Vista you do this by deleting all files in this directory: c:\Users\[YourUserName]\AppData\Roaming\Microsoft\VisualStudio\8.0\ReflectedSchemas

5.) Restart Visual Studio

Scott’s blog post here has the details.

http://weblogs.asp.net/scottgu/archive/2006/12/15/asp-net-ajax-1-0-release-candidate-now-available.aspx

New Ajax Social Networking addition for Blogs

So I got an emailo from Microsoft MVP Scotte Clark letting me know about this cool (free) service at wHooIz.com

wHooiz.com

Ceck out the the “Ajax Recent Visitors” block furthewr down on this page.

AJAX Service TimeOut question from yesterda’s Live-From-Redmond !

Yesterday someone asked how to manually set Service Call Timeouts.

I had no idea.

But Bertrand Le Roy did. (Bertrand is an Engineer on the team and seems to know EVERYTHING about MS AJAX)

Ayway – Bertrand pointed me at these.

Sys.Net.WebRequest.set_timeout

Sys.Net.WebRequestManager.set_defaultTimeOut

I didn’t see these in the documentation (and it’s not searchable yet) but  after I know what to look for… there it was.

Thanks (again) Bertrand !

AJAX Predictive Fetch – Webcast Materials

Many thanks to everyone who attended.

Here is the source code and PowerPoint. Please feel free to post questions.

LFR-PredictiveFetch.zip

The Advantages of Microsoft AJAX

One of the PUMs (Product Unit Manager) in my team, Shanku Niyogi, is an AJAX guru and recently wrote this internally to describe the advantages of Microsoft AJAX.

 

I thought it was a great write up and I’m reprinting it here with his permission.

 

——————

 

There are a wide variety of good AJAX libraries available for ASP.NET today. This shows the demand for AJAX capabilities for the ASP.NET platform.

 

With ASP.NET AJAX, Microsoft is delivering a high-quality AJAX framework that will be fully integrated into ASP.NET and Visual Studio. We believe that delivering integrated support for AJAX in our platform will have several benefits for ASP.NET developers:

 

-          ASP.NET AJAX will be a completely free release, and will be integrated into the free .NET Framework release in future versions.

 

-          The release version of ASP.NET AJAX, due out around the end of the year, will be fully supported through Microsoft Product Support for the standard (7+3) period. This means that if you have any issues with this product in development or deployment, you can call up Microsoft to get help at anytime. It also means that we will issue hotfixes and service packs.

 

-          ASP.NET AJAX includes integrated authoring support in Visual Studio 2005, and will include even better support in the next version of Visual Studio.

 

ASP.NET AJAX is also more than just a basic library for incremental rendering.  ASP.NET AJAX also provides a rich end-to-end AJAX library that includes a full networking and web services stack, a component model with support for rich interactive behaviors, support for localization and globalization, and other capabilities required for rich web client programming. The client script library for ASP.NET AJAX is available in full source form (debug and release versions), and can be freely modified.

 

On top of the core package, you can use the ASP.NET AJAX Control Toolkit, which adds a rich library of controls for AJAX development. The Control Toolkit is free and available with a source license that allows full modification and redistribution.

 

From a pure performance perspective, there are several issues with the assessment that are either inaccurate or that we have improved in the Beta. 

 

1.       As Bertrand has mentioned in this comments, doing a pure measurement of script size on a small sample is misleading. The scripts are loaded only once, and then cached on the client. This means that over any real world web site, the cost of downloading the scripts are amortized over the entire site.

 

2.       As Christophe mentioned, the Atlas tests Daniel ran were on the debug version of scripts. In CTP versions of Atlas, this was the default. In the ASP.NET AJAX Beta, scripts are release mode (smaller) and compressed by default. The compressed results are around 14K, which is around the size of an image on the page.

 

3.       We have also done some significant work in reducing packet size for UpdatePanel. In the attached version of the project (which implements the same sample in Daniel’s blog), the packet size of the update is 485 bytes. The UpdatePanel architecture includes features like triggers and conditional updates that allow you to finely customize the update characteristics of your page.

 

4.        ASP.NET AJAX also includes a very rich client-side framework, so that you can build client-centric applications. This goes well beyond basic direct AJAX, with access to server-based web services, a rich client component model, support for localization, and many other features. The client-centric framework requires an approximately 9K subset of the ASP.NET AJAX scripts. A version of the sample written with client-centric techniques (also in the attached project) uses a packet size of approximately 20-30 bytes (depending on the length of the date string).

 

Some other points in the study that are inaccurate or outdated:

 

1.       In terms of browser support, ASP.NET AJAX supports IE, Firefox/Mozilla, and Safari today, and will support Opera by release. It will also support the next version of IE Mobile.

 

2.       In addition to ASP.NET, ASP.NET AJAX supports other servers such as PHP – so if you have a mixed deployment, you can take advantage of ASP.NET AJAX with these servers as well.

 

3.       The ASP.NET UpdatePanel can automatically detect downlevel browsers that are not AJAX capable, and turns off incremental rendering for the page. This allows you to easily build AJAX-enabled pages that still work on non-AJAX browsers.

Microsoft AJAX Beta 2 shipps.

Check out the update here.

http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

I’ll be re-doing all the How-Do-I Atlas / AJAX videos.

Watch the videos and make suggestions here.

http://www.asp.net/learn/videos/default.aspx?tabid=63

Animated .GIFs for your UpdateProgress Control

MS AJAX developers need to be able to tell their users when the browser is waiting for a response from a network call.

Usually the text message is accompanied an animated .GIF

Here is a cool web site that lets you just choose your color scheme and pick one of the 10 different types of .GIFs that are available.

Check is out here:

http://www.ajaxload.info/

Reset the MS AJAX TimerControl’s countdown.

Are you using a MS AJAX timer control to auto refresh content on your page but want to reset the timer when a user action forces a refresh. In your server side code you can reset the timer by adding two lines like this: Protected Sub ButtonResetTimer_Click(ByVal sender As Object, ByVal e As System.EventArgs) TimerControl1.Enabled = False TimerControl1.Enabled = False End Sub

Does your MS AJAX Popup FLASH ?

When you are using an MS Ajax popup that is not displayed by default, are you seeing yor popup FLASH for a second when the page loads ?Try this. Define CSS classes for the item to be poped up. Make sure the default CSS class has a visibility:hidden attribute. Like this…….

Then, use classes like this. Default: The “FLASH” goes away.

Official ATLAS BETA Announcement

From ScottGu’s blog.

ASP.NET AJAX Beta 1 Released

Last month I posted about the official new name for “Atlas,” and discussed the roadmap plan for shipping a free, fully-supported, v1.0 release that works on top of ASP.NET 2.0 and Visual Studio 2005.

Today I am very pleased to announce the first official Beta release of Microsoft ASP.NET AJAX v1.0. You can download it now from the http://ajax.asp.net site. Available on the site are three download options:

1) The ASP.NET AJAX v1.0 “Core” download. This redist contains the features that will be fully supported by Microsoft Product Support, and which will have a standard 10 year Microsoft support license (24 hours a day, 7 days a week, 365 days a year). The download includes support for the core AJAX type-system, networking stack, component model, extender base classes, and the server-side functionality to integrate within ASP.NET (including the super-popular ScriptManager, UpdatePanel, and Timer controls).

2) The ASP.NET AJAX “Value-Add” CTP download. This redist contains the additional higher-level features that were in previous CTPs of “Atlas,” but which won’t be in the fully-supported 1.0 “core” redist. These features will continue to be community supported as we refine them further and incorporate more feedback. Over time we’ll continue to move features into the “core” download as we finalize features in this value-add package more.

3) The ASP.NET AJAX Control Toolkit. This project contains 28 free, really cool, AJAX-enabled controls that are built on top of the ASP.NET AJAX 1.0 “Core” download. The project is collaborative shared source and built by a combination of Microsoft and non-Microsoft developers, and you can join the community or just download it on CodePlex today.

Some of the Changes with the Beta

There are a number of changes that the team has made with this beta release. A few of the significant changes include:

Performance and Download Size Optimizations

Previous ASP.NET AJAX CTPs relied on the browser downloading a single large, JavaScript file to the browser that contained all of the features. With this Beta release we have spent a lot of time on factoring out features into multiple files (so you don’t have to download them unless you use them), and in optimizing the bandwidth size of the overall library. The ASP.NET AJAX “Core” download now includes two JavaScript libraries that are used to support all of its features:

a) The MicrosoftAjax.js.gz script file contains the core JavaScript type-system, component/control model, JSON networking/serialization stack, and application-serviceas features (Profile + Authentication). It is now 14.8k in size.

b) The MicrosoftAjaxWebForms.js.gz script file then adds the support to enable UpdatePanel scenarios and partial page rendering. It is 6.4k in size.

These files are only downloaded by a browser once when visiting a site — they are then cached on the client and reused across all pages and repeat visits. The new size targets should ensure a snappy and speedy experience the first time you hit a site.

In addition to optimizing the initial download size of the JavaScript libraries, we have spent time optimizing the network traffic size of client JavaScript callbacks to the server. Controls like the UpdatePanel, UpdateProgress, and Control Toolkit controls no longer emit xml-script by default, and instead just emit 1-2 lines of JavaScript (which can help significantly reduce the network traffic size on the wire).

We have also moved from using JavaScript closure-based classes to using prototype-defined classes in the core type system, which we’ve found reduces memory usage for most common application scenarios.

Safari Browser Support

Previous ASP.NET AJAX CTPs didn’t have great support for Safari (UpdatePanel didn’t work at all). With this Beta we have added Safari as a fully tested and supported browser.  We are currently working on adding Opera support as well – although we aren’t ready yet to call it supported with this build (stay tuned for updates).

Significantly Better Debugging Support

As anyone who has spent a lot of time doing it can attest, debugging JavaScript is often not a lot of fun. We’ve made two significant changes with this Beta that will help improve the debugging experience with the Microsoft AJAX Library considerably:

1) By moving our JavaScript class definitions from being closure-based to prototype-based, you can now use the existing Visual Studio 2005 script debugger (and/or other existing JavaScript debuggers) to better inspect and step through JavaScript objects. Closures previously hid a lot of inspection information.

2) We invested a lot of time putting together an automated JavaScript build environment that enables us to produce two versions of all of our JavaScript files: a retail version that is optimized for performance and download size, and a fully instrumented debug version that is optimized for helping you catch issues with your code during development. Every function within the debug version of our script files now includes parameter and argument validation code that verifies that the function is being passed the correct arguments before running, and that will assert with stack trace information if not. This can help to more easily pinpoint errors with your JavaScript code early, and hopefully significantly improve JavaScript debugging.

Note: By default, the decision to use the retail vs. debug versions of the AJAX script libraries is driven by the <compilation debug=”true|false” /> setting within your web.config file. Because this client-side parameter validation code significantly increases the size and performance overhead of the client-libraries, make sure you set debug=”false” before deploying any application (for more reasons on why you should always set debug=”false” when deploying ASP.NET applications, please read this past post of mine).

Another Note: Our plan is to have the next version of Visual Studio use the same argument validation metadata that we use at runtime with debug scripts to also drive IntelliSense and syntax checking of JavaScript within the IDE. You can add this metadata to your code to improve validation, error checking, and eventually IntelliSense of your own JavaScript libraries as well.

UpdatePanel Improvements

The UpdatePanel control have been updated significantly with this Beta release to incorporate customer feedback. In addition to adding Safari browser support, the UpdatePanel control now has new support with this Beta for:

a) Client-side script event hooks to let you write client-side JavaScript to more easily participate in callbacks.

b) The ability to contain controls within an UpdatePanel that trigger both partial-page postbacks as well as normal postbacks (you now get to choose depending on your scenario). You can also now disabled child controls from causing UpdatePanel postbacks at all.

c) The ability to use ASP.NET validation and Wizard controls within UpdatePanel controls (there were some bugs that prevented this before).

d) The ability to dynamically create and add UpdatePanel controls into a page, rather than having to statically define them. This is particularly useful for control developers who can now instantiate and use UpdatePanel controls within their composite controls.

e) The ability to have multiple UpdateProgress and Animation controls on a page that can run conditionally based on which UpdatePanel callback is occurring.

f) The ability to declaratively specify how long to wait before an UpdateProgress control should become visible. This enables you to avoid showing progress status for quick UpdatePanel callbacks.

g) Support for screen readers and other accessibility tools with UpdatePanel scenarios to better implement Section 508 standards.

Important Beta Note: the UpdateProgress control with the Beta is currently shipping in the “Value-Add” download, so you will need to add this to your site in order to use it.  With the next beta refresh it will be moved to the “core” download, and will be a fully supported scenario. 

Lots of Improvements in the Client Script Library Stack

We’ve incorporated a lot of customer feedback and cleaned up, simplified, and enhanced a lot of the client-side JavaScript library APIs. In addition to moving from closures to prototypes, a number of other API cleanup changes have been made including:

a) Simpler client JavaScript event model. It is now easier to define and attach events on the client. Object events are also now created on demand to reduce startup time and the size of the working set.

b) Simpler Component, Behavior, and Control types. APIs can now be used without first needing to instantiate their related objects, and on-demand semantics have been added to improve performance.

c) Client networking improvements. Default callback functions and method-name semantics provide a much easier way to perform common asynchronous callbacks.

d) Membership and Profile APIs. Simpler APIs for interacting with the Membership and Profile APIs from client-side JavaScript are now supported.

Better Compatibility with other AJAX Libraries

One challenge with JavaScript is that collisions between different client-side JavaScript libraries can be ugly. Previous ASP.NET AJAX CTPs defined a global helper function named $( ) that conflicted with other common JavaScript libraries (including Prototype and Scriptaculus).

With this Beta we have renamed our $( ) function to $get( ) and made a few other naming changes to help enable multiple independent AJAX libraries to play nicely together on the same page.

Source Modification License

One common request we have received is the ability for developers to make source modifications to the core Microsoft AJAX JavaScript library (to add a small feature, tweak an implementation, or make a tactical bug fix).

We are going to provide a license to explicitly allow custom modification of the libraries, and the ScriptManager API that ships with this Beta now allows you to provide alternative implementations/tweaks of the built-in JavaScript libraries. In addition to allowing you to tweak the libraries for your own applications, the license will also grant redistribution rights so that you can ship them with your own components and extensions. (The one requirement for redistributing your own custom version is that you need to change the namespace to avoid conflicts.)

We think the combination of having both full enterprise-level support (with 10-year support services), along with modification redistribution rights is a really powerful offereing that will provide developers with a ton of flexibility regardless of their project type, size, or target audience.

Next Steps

As you probably noticed from the paragraphs above, there are a number of new features and changes with this Beta. Existing ASP.NET AJAX code will need to be updated to reflect these changes.

If you have been using server-side ASP.NET AJAX features, you should find the updates relatively straightforward. These will mostly involve renaming the control prefix from <atlas:> to <asp:>, modifying the trigger syntax for UpdatePanel controls, and making small syntax changes to how extender controls in the Control Toolkit are declared.  You can read a migration guide with the details on how to-do this here.

If you have created your own JavaScript class types and, or if you interact with the component model directly, you will need to make more significant changes. What we’ve found when updating samples is that the JavaScript changes are not too complicated by themselves – what is frustrating is that JavaScript’s type-less flexibility prevents tool compilation checking, and forces you to update things iteratively to find and fix each change, which can be tedious and annoying. To help with migration from the CTP to the Beta, the ASP.NET AJAX Team has published a detailed document listing the specific changes that have been made and which includes code samples that show before and after versions of common patterns and APIs usages. We will be publishing this document shortly here.

The ASP.NET AJAX team will also be monitoring the forums closely over the next few weeks to help people with migration questions and any issues they find. Please post in the forums to get help if you run into any issues, find any bugs, or need any help.

We are really looking forward to having lots of people use the Beta and to getting more feedback. We believe the API definitions for the features currently in the ASP.NET AJAX v1.0 Core download are now pretty close to being final, and our plan for the rest of this year will be to keep taking feedback and bug reports, and stabilize and lock down the release. Our plan is to release a beta refresh in a few weeks that incorporates customer feedback, then ship a RC release after that, and then ship it as a fully supported 1.0 release once people feel it is ready.

ATLAS (MS AJAX) Goes Beta!

Microsoft ASP.NET AJAX version 1.0 Beta Released

The first public Beta release of Microsoft ASP.NET AJAX v1.0 (code-named “Atlas”) is now available for download. ASP.NET AJAX is a free framework for creating client-centric, interactive Web applications that work across many popular browsers and on any server platform. This Beta release is a preview of the fully-supported version of ASP.NET AJAX scheduled for release by the end of this year.

Get the new bits and check out the new docs at www.asp.net !

Miscroft AJAX and Caching

Make sure debug=false is set in the <compilation> section in config.

Then the web resource URLs will be cached (like the client libraries).

The “t=” in the web resource URLs represents the assembly’s last modified date.

As long as you don’t change the atlas assembly, the same “t=” should be generated.
 
Proxies should get cached as well.. They are retrieved from the server as the browser parses the page, and loads referenced scripts.

This is completely orthogonal to server lifecycle events such as Page_Init.
 
There are some enhancements for caching in MS AJAX RTM  that make the scenario even better.

Thanks to Nikhil Kothari for my edification.