Migrating to ASP.NET AJAX Beta 1

If you're trying to migrate from previous Microsoft Atlas releases to the new ASP.NET AJAX Core Beta 1 you'll quickly find out that several things have changed.  I was playing around with the AutoCompleteExtender this evening and noticed that it isn't in the "core" installation but has been moved into the CTP installation.  It's been changed a bit too.  In previous releases you would define it using syntax similar to the following:

<asp:TextBox id="txtCountry" runat="server" />
<atlas
:AutoCompleteExtender ID="aceTxtCountry" runat="server">
   
<atlas:AutoCompleteProperties Enabled="True"
          ServiceMethod
="GetCountries"
          ServicePath
="~/CustomerService.asmx"
          TargetControlID
="txtCountry" MinimumPrefixLength="1" />
</
atlas:AutoCompleteExtender>

The AutoCompleteProperties property of the AutoCompleteExtender control has been removed and everything is defined directly on the AutoCompleteExtender tag itself using attributes now:

<asp:TextBox id="txtCountry" runat="server"/>
<
asp:AutoCompleteExtender ID="aceTxtCountry" runat="server" 
    ServiceMethod
="GetCountries"
    ServicePath
="~/CustomerService.asmx"
    TargetControlID
="txtCountry"
    MinimumPrefixLength
="1"  />

There are some other subtle changes that can bite you too on this control.

If you're calling Web Services from ASP.NET AJAX enabled pages you'll also have to make a change to the service.  Web Service classes now have to be defined using the ScriptService attribute as shown next:

[WebService(Namespace "namespaceUri")]
[WebServiceBinding(ConformsTo 
WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class WebService : System.Web.Services.WebService {
   
//Web Service Code
}

I'm hoping this change won't make it into the final release (although admit I'm still a bit vague on the rationale so I could change my mind) because in enterprise scenarios you may not have control over a Web Service and be able to add the attribute.  That means you'd have to make a wrapper Web Service that defines the ScriptService attribute and calls the "real" Web Service to get the data or write another custom solution.  We'll see what happens though...

comments powered by Disqus

4 Comments

  • I hope the AutoCompleteExtended thing is a bug; if not it's very poor design.

    I noticed with Fiddler that Atlas hooks converted the web service into JSON instead of SOAP - perhaps this new attribute is a way to fine grain control that change?

  • Interesting....I haven't taken a look with Fiddler using the beta 1 build. It could be that the attribute controls that aspect of it though. I'm still a bit unclear on it's overall purpose other than clearly identifying that it's OK to call the service using AJAX.

  • I have been unable to get the AutoCompleteExtender to work since installing the Beta1 and also when I installed the Beta 2.

    Everything compiles and I tested out my webservice and it works. I loaded the webservice in my browser and got the pretty Microsoft webservice page with all the info about the service. I entered my inputs and out came the correct XML. So I know it isn't my webservice. I am pretty sure that the AutoCompleteExtender is basically being ignored.

    Any ideas?

  • The AutoCompleteExtender was moved into the Web Preview dll temporarily. So, you'll want to install the value-add CTP and create that type of Website using VS.NET 2005 in order to use the AutoCompleteExtender control in your pages (you'll see a new template options show up in the new Website dialog). I don't know when it'll be moved back into the core download but I'm hoping it's fairly soon since it's a powerful control.

Comments have been disabled for this content.