enter the pirate

A poorly maintained blog of technology

Archive for April, 2008

I Hate ASP.NET AJAX

There!! I’ve said it!!!

Don’t look at me like that, you know you’ve all been thinking it!

I just overcame the wonderful “[Method Error 500]” error while working with a set of ASP.NET AJAX CascadingDropDowns. What a lame error. Spend some time researching the problem and you’ll find a uniform response: “That error could mean that anything is wrong”. Fantastic!! That’s exactly how I wanted to spend two hours of my time. (That’s sarcasm, by the way)

Everyone’s solution is different because everyone’s problem is different; but, here’s what solved it for me.

I’m using a ContextKey to select data specific to the user who is accessing the application. Since (inspired by true genius… more sarcasm [hopefully you'll pick up the I'm somewhat sarcastic]) the ContextKey attribute of the CascadingDropDown can’t be DataBound, you have to set the ContextKey property of the CascadingDropDown object on Page Load. Well, I added another CDD and forgot to set the ContextKey in the Page Load even handler.

Bada-Bing!! That was it.

Sure, I should have remembered that adding a new CDD to the page meant setting it’s ContextKey on Page Load; but I didn’t. Because the code never reached the web service function, there was no way to step through with the VS 2005 debugger. Fun!

Remember, “[Method Error 500]” could mean your dog just died.

Discovering Web 2.0

Well, I’m officially late to the party. Spending the last two years focused on desktop software development, I let the progress of web development pass me by. As the primary source of production for a very small development company, keeping up with the progress of both technologies was a luxury I couldn’t afford.

So here I am, playing catch up in the web world.

Having worked with Microsoft technologies for more than five years, ASP.NET AJAX is where I started to discover Web 2.0. (Honestly, I can’t stand the term Web 2.0… it’s a buzzword for managers) I understood that the foundation of this new generation of web technology was asynchronous data access, allowing for partial page load and ridding our applications of crunchy postbacks.

For developers that are new to the idea of Asynchronous JavaScript and XML (AJAX) and have a good working knowledge of .NET technologies, Microsoft’s ASP.NET AJAX Control Toolkit is a good way to get started. Using either Visual Studio 2005 or Visual Web Developer (a free Visual Studio product aimed at the beginning web developer) you can drag and drop your way to your first AJAX experience. The all important “Hello World”.

When you’re done frustrating yourself with the ASP.NET AJAX Control Toolkit, here are some JavaScript frameworks that I can recommend:

mootools

Prototype JavaScript Framework

dojo Toolkit

script.aculo.us