I am developing an application which does not really make use of Atlas controls but has a significant amount of Atlas scripting code to migrate.
I am not found of declarative scripting but maybe I am old-fashioned: I like to step through my code to debug it. My opinion is that declarative scripting is only good as the output of code-generation tools. It is not something that developers should write in a text editor.
So, I have got script to migrate and I have read the documentation available at:
Downloading and installing ASP.NET Ajax Beta 2 is well explained in the documentation but I had to do a bit of guessing as well as exploring Microsoft’s code to migrate my own code. I deliver my findings below:
Migrating client script
- To use client scripting of html components, you need to add a reference to PreviewScript.js in your ScriptManager as shown below:
<asp:ScriptManager ID="ScriptManager" runat="server">
- $(id) is now $get(id)
- The Sys.UI namespace is now Sys.Preview.UI
- Sys.UI.Select is now Sys.Preview.UI.Selector
- Sys.UI.CheckBox.click.add(handler) is now Sys.UI.Preview.CheckBox.add_click(handler)
- Sys.UI.Select.selectionChanged.add(handler) is now Sys.Preview.UI.Selector.add_selectionChanged(handler)
- $addHandler/$removeHandler is the new way to add event handlers
- Sys.UI.Control.get_enabled() and set_enabled() no more work
Migrating web service calls
- You need to decorate your web services and page methods with new attributes as explained in http://blogs.msdn.com/sburke/archive/2006/10/21/hint-components-that-use-web-services-with-asp-net-ajax-v1-0-beta.aspx.
- The prototype of asynchronous calls to web services and page methods has been simplified, but this is well explained in the documentation listed above.