I spent the last few days working on various Ajax related projects and so here come some updates for some tools and samples over the next few days. First up is installation and updating of demos for MS Ajax RC and a quick review of the update process.

 

The good news is that the update to the RC version was relatively painless. Microsoft did change the namespace and assembly name for the main MS Ajax (RTM) assembly so there was a bunch of hunting down of existing assembly and namespace references. There were a few tricky issues like the ClientScriptProxy class I wrote about a few days ago which checks for the presence of ScriptManager by trying to dynamically load the class – which failed due to the new assembly strong name and it wasn't immediately obvious why my scripts where not working properly in combination with UpdatePanels. But that’s a special case for sure although that’s something to keep in mind for the future: Future version changes can break that code again so I’ll need to find a better way to detect MS Ajax.

 

In addition there are a number changes that have to be made in web.config. If you’re upgrading be very sure to compare your Web.config CLOSELY to the web.config file in the distribution directories (program files\Microsoft\ASP.NET \ASP.NET 2.0 AJAX Extensions (or if you’re also using the preview version the Futures version of web.config). Most existing assembly references have changed and there are many subtle changes in the configuration – it took a while to get all of these ironed out when I first tried to rush through the config update instead of closely comparing each of the settings properly. <s>

 

There are also changes in the way scripts are referenced from the ScriptManager. Tthe native scripts of MS Ajax drop the name prefix in the script manager so their easier to remember and type. Our own scripts however will need full assembly resource references. Problem is that these types of issues won't show up until runtime so you have to make sure to run through everything using these scripts. You can use a careful search and replace in files to get this done if your project is large enough to warrant it. Look for anything Microsoft.Web.Extensions and replace that with System.Web.Extensions. Also search for Preview.js and PreviewGlitz.js and any of the other script reference files and remove the Microsoft.Web.Extensions or Microsoft.Web.Preview prefixes.

 

Other than that the update went pretty smooth. All my existing code ran fine. For the samples I put back some code I had to take out for the beta, that used DataTable results to display in the browser. ADO.NET object serialization support is back in the RC thankfully although it is part of the Futures package, not the base package. Apparently Microsoft is not quite sure what they want to do with ADO.NET objects marshalled to the client as client support for these objects is still very slim.

 

I did run into some really wonky issues with Web Service calls however. It looks like there's a caching bug of some sort that doesn't refresh Web Service Proxies when the ASMX file changes. The only way to get the proxy loader to show the changes is to touch web.config or otherwise cause the AppDomain to unload. This in Debug mode which is strange.

 

I also ran into an odd situation where I had two [WebMethod] implementations:

 

public DataTable GetCustomerList()

 

public CustomerEntity GetCustomer(string Id)

 

and MS Ajax insisted on generating the proxy for GetCustomer() without the ID parameter. I moved things around added methods and it would show new methods but still show GetCustomer() without the ID parameter. Renamed the method and it worked fine. Renamed back and it failed again.  I was about to bug this on Connect, but now I can no longer duplicate it - it now generates the proper signature. I can't figure out for the life of me what the difference is/was. It works now...

 

I’ve updated my samples online and have also uploaded them along with the last set of slides:

 

Online MS Ajax Samples

Sample Code Download for MS Ajax RC

 

 

There’s not a lot of change in the samples, although I’ve put back some code I had to pull out for the beta releases because they were lacking the ADO.NET support. I also added a couple more simple Web Service examples to better demonstrate passing objects between client and server...

 

 

BTW, it looks like there's finally some reasonable client documentation for the base Ajax extension library. It's about time! OTOH, there's still zero documentation for the Futures library stuff <shrug>