Archive for April, 2009

Use ExpressionBuilder To Avoid “Server tags cannot contain constructs”

The ExpressionBuilder is still unknown to a lot of developers that haven’t experienced the sadistic pleasure of localizing a web application. It was introduce in ASP .NET 2.0 and allows you to bind values to control properties using declarative expressions. I learnt about the ExpressionBuilder when I was doing some research on localization best practices [...]

Maintaining Context in a JavaScript Callback

For reference. To maintain context in a JavaScript callback use a closure and an anonymous function. For example: var curObj = this; //closure to get context in callback $(‘#foobar’).animate({ height: 100 }, 1000, "jswing", function() { alert(curObj.someProperty); }); To avoid the anonymous function use the Microsoft Ajax helper Function.createDelegate as follows: this.animate = function() { [...]