Object Doesn't support this property or method on automatically generated property |
Others |
Written by Dicky |
Wednesday, 29 June 2011 08:29 |
If you use classic ASP and JSON object to auto-generate your property. You might come to this error "Object Doesn't support this property or method" when trying to access the object property. I have tried IsNull() IsObject(), Is Nothing keyword and none of them is working. The best way to handle the error is by handling the error, makes a lot of sense I guess!? So say that you want to access property .color from your Car JSON object. When you try to access Car.color, if the color property doesn't exists, it will give you that error. Here's what you can do:
That way the code will continue to execute without error and we can go on with our life! |