Thursday, January 24, 2008

Creating Your Own Ajax ControlToolkit Extender Control

Great resources here:
I can across an interesting gotcha when creating my first ajax control extender (created a validator extender control, which "highlight" a target control if validation fails)


The javascript error only happens in IE. FF is quite forgiving.

Expected Identifier, string or number

When I clicked Yes to debug, it takes me to the below line of code in Visual Studio...

$create(KbWebToolkit.ValidatorHighlightBehavior, {"HighlightControlID":"",
"HighlightCssClass":"error_highlight","id":"NReq_HL"}

Debugging it further would return the javascript below:

Microsoft JScript runtime error: 'KbToolkit' is undefined

Fix:
Remove the last comma in the prototype definition.