AJ’s blog

May 12, 2007

Javascript and ASP.NET

Filed under: .NET, .NET Framework, ASP.NET, Software Development — ajdotnet @ 4:03 pm

ASP.NET was never a pure server side framework. Right from Version 1.0 it employed scripts for client side validation. Back then it was meant to…, well set IE users apart, because it worked only as improvement for them. Complementing one’s own server controls with script was the champions league of ASP.NET development — and deployment of these controls was a paint in the… (children around? Sorry!)

Anyway, much is changing in this area. With ASP.NET 2.0 Microsoft has introduced the WebResourceAttribute to adress the deployment problem. (See Creating Custom ASP.NET Server Controls with Embedded JavaScript for a better example.) Ajax is doing away with the browser dependency issues and Microsoft has changed its attitude accordingly, resulting in cross browser capabilities in ASP.NET AJAX.

There is still some work to do to better integrate server side and client side coding model. The ASP.NET AJAX Control Toolkit uses some patterns to better handle scripts (via the RequiredScriptAttribute, though not documented) and to address client side properties and events. Supporting postbacks and server side events is still a little awkward, though.

One thing is for sure: With ASP.NET AJAX Microsoft is taking ASP.NET control development as well as scripting to the next level (if only of complexity). If you’ve coded controls using script before, this is a good thing for you. Or it will render your patterns obsolete, who knows. If you’ve only scratched scripting yet, well, prepare for some work. Javascript is not as easy at is seems and ASP.NET AJAX definitely pushes the limits.

That’s all for now folks,
AJ.NET

kick it on DotNetKicks.com

Blog at WordPress.com.