Monday, April 28, 2008

Joe Stagner and others have produced a long line of how-to jumpstart videos on learning ASP.NET AJAX and the community supported AJAX Toolkit control extenders.  Video 3 of 72 , How Do I: Use the ASP.NET AJAX CascadingDropDown Control Extender, has some errors that may cause some newbies to get hung up on learning these tools, which is a shame.

First off, I'm a C# developer, and the videos are written from the VB.NET mind set.  If you're like me, you'll need to note that the "shared" VB keyword is functionally the same as the "static" keyword in C#.  You'll also need to take note that the method call QuerySimpleCascadingDropDownDocument returns an array of CascadingDropDownNameValue objects, so you, like I, may miss the fact that he's returning an array from the methods GetDropDownContents and GetDropDownContentsPageMethod.

The big issue that I and apparently others came across is the fact that upon running the application as demonstrated, the dropdowns will be populated with the error message:

[method error 500]

The fix is simple: in the HTML, you must define the ServicePath as follows:

...ServiceMethod="GetDropDownContents" ServicePath="~/CarsService.asmx"...

Note the "~/" at the beginning of the ServicePath.  Without this, the service will get called, you can step into it, yet the results will be an error. 

Comments are closed.