ASP.NET 4.0 AJAX Preview Release 4 Setup

 

I downloaded and setup the javascript files for ASP.NET 4.0 AJAX Preview Release 4.  This release was put up last Thursday night / Friday morning.  Since I had a talk on Saturday at the Atlanta Code Camp on this subject, I decided to take the plunge and get my code moved over and running on it to show the latest and greatest running.  While the intelligence of that decision can be debated for a long time, I got it done.  I wanted to share some stuff about the setup of the product.  There are three sets of javascript files that are in the download, previously, there were two sets of files.  The new file is MicrosoftAjax.js.  This file is a little bit surprising because there is a file in the base Microsoft ASP.NET AJAX called this.  I read the instructions.  The instructions were a little bit blurry on this setup subject.  They sort of implied that the MicrosoftAjax.js files was only needed if you were NOT using the ASP.NET 3.5 Script Manager.  Any way, I found this to not be true.  To get things setup correctly, this is the setup I found that worked.

<asp:ScriptManager ID="sm" runat="server">
    <Scripts>
        <asp:ScriptReference Name="MicrosoftAjax.js"  Path="~/js/MicrosoftAjax.js" />
        <asp:ScriptReference Path="~/js/MicrosoftAjaxAdoNet.debug.js" />
        <asp:ScriptReference Path="~/js/MicrosoftAjaxTemplates.debug.js" />
    </Scripts>
    <Services>
        <asp:ServiceReference Path="~/TwitterService.svc" /> <-- this is my file, so you probably don't need it.
    </Services>
</asp:ScriptManager>

Bertrand LeRoy suggested this setup below.  Given that he works on the ASP.NET team, I'll take his suggestion.  :-)

<asp:ScriptManager ID="sm" runat="server">
    <Scripts>
        <asp:ScriptReference ScriptMode="Inherit" Name="MicrosoftAjax.js"  Path="~/js/MicrosoftAjax.js" />
        <asp:ScriptReference ScriptMode="Inherit" Path="~/js/MicrosoftAjaxAdoNet.js" />
        <asp:ScriptReference ScriptMode="Inherit" Path="~/js/MicrosoftAjaxTemplates.js" />
    </Scripts>
    <Services>
        <asp:ServiceReference Path="~/TwitterService.svc" />
    </Services>
</asp:ScriptManager>
 

 

I hope that this helps you out in the area of getting the preview setup.

Original Url: http://morewally.com/cs/blogs/wallym/archive/2009/03/16/asp-net-4-0-ajax-preview-release-4-setup.aspx

2 Comments

  • You are a life-saver! I am using this in a project I am working on, and was going to abandon it because I could not get it to work. Thank you!

  • You shouldn't set the path to MicrosoftAjaxAdoNet.debug.js (ever) but to MicrosoftAjaxAdoNet.js. If you want debug mode, you should set the scriptmode on each of those references to Inherit and set the scriptMode top debug on the script manager.

Comments have been disabled for this content.