Wednesday, April 28, 2010

Validation Summary, "Object doesn’t support this property or method" error

This is an issue that I could only came across to on IE7 and not any of the other browsers. Nonetheless, I spent almost a day trying to figure out why my asp.net validators threw "Object doesn’t support this property or method" javascript error everytime a validation failed or in other words, it wanted to show the ValidationSummary.
Here's how to reproduce the issue :

- Attach a validation control to a control, and put a validation summary in the page anywhere.
- Have any control…. any control with ids “pre”, “post”, “first”, “end”, "result", "headerSep" and you’ll get the   java script error when validation summary needs to be updated at the end of validation.


Solution? Just make sure you don't have any controls identified with with "pre", "post", "first", "end", "result", "headerSep". If you do, rename them

Here's more info on this:


http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=408628