How to Use the Preview Scripts in ajax 4.0

This preview consists of release and debug versions of the following script resources:

· An updated version of MicrosoftAjax.js

· MicrosoftAjaxTemplates.js

· MicrosoftAjaxAdoNet.js

· MicrosoftAjaxDataContext.js

· An updated version of MicrosoftAjaxWebForms.js

To use the new features in a Web page, enable the updated version of Microsoft Ajax on the page. This is done either by including a <script> tag that references MicrosoftAjax.js (or MicrosoftAjax.debug.js), or by including a server-side ScriptManager control in the page under which you add a ScriptReference to the new MicrosoftAjax.js.

Then, simply include the new script files:

· MicrosoftAjaxTemplates.js (or MicrosoftAjaxTemplates.debug.js)

· MicrosoftAjaxAdoNet.js (or MicrosoftAjaxAdoNet.debug.js).

· MicrosoftAjaxDataContext.js (or MicrosoftAjaxDataContext.debug.js).

by adding corresponding ScriptReferences (under the ScriptManager control) or <script> tags.

Example using Script Manager:

<asp:ScriptManager ID="sm" runat="server">

<Scripts>

<asp:ScriptReference Name="MicrosoftAjax.js" Path="~/scripts/MicrosoftAjax.js" />

<asp:ScriptReference ScriptMode="Inherit" Path="~/scripts/MicrosoftAjaxTemplates.js" />

<asp:ScriptReference ScriptMode="Inherit" Path="~/scripts/MicrosoftAjaxAdoNet.js" />

<asp:ScriptReference ScriptMode="Inherit" Path="~/scripts/MicrosoftAjaxDataContext.js" />

</Scripts>

</asp:ScriptManager>

Example using <script> tags:

<script type="text/javascript" src="../scripts/MicrosoftAjax.debug.js"></script>

<script type="text/javascript" src="../scripts/MicrosoftAjaxTemplates.debug.js"></script>

<script type="text/javascript" src="../scripts/MicrosoftAjaxAdoNet.debug.js"></script>

<script type="text/javascript" src="../scripts/MicrosoftAjaxDataContext.debug.js"></script>

If you wish to use UpdatePanel, you will need to also include the updated version of MicrosoftAjaxWebForms.js in your page. An example of this is provided in the “UpdatePanel Support” section of this document.

Posted in: asp.net | Tags: inherit ajax 4.0 updatepanel preview scripts microsoftajaxtemplates.js microsoftajaxadonet.js microsoftajaxdatacontext.js microsoftajax.js scriptmanager scriptreferences scriptmode microsoftajaxwebforms.js