I just discovered that User Controls seem to let you set a value for any property name for anything in the markup even if that property doesn't exist in the user control class definition. The page doesn't error or do anything to let you know a potentially
invalid property has been assigned. It seems that User Control will accept any property.
Now, I guess this may be by-design, but is there anyway you can enforce property assignments to ensure they exist? I'd really like to throw an exception if an non-existent property is used.
Member
3 Points
25 Posts
Catching usage of "undefined" properties on User Controls
Oct 31, 2009 01:46 PM|richhollis|LINK
I just discovered that User Controls seem to let you set a value for any property name for anything in the markup even if that property doesn't exist in the user control class definition. The page doesn't error or do anything to let you know a potentially invalid property has been assigned. It seems that User Control will accept any property.
Now, I guess this may be by-design, but is there anyway you can enforce property assignments to ensure they exist? I'd really like to throw an exception if an non-existent property is used.
Thanks
user control property assignments not defined
Participant
1550 Points
307 Posts
Re: Catching usage of "undefined" properties on User Controls
Oct 31, 2009 03:04 PM|ratish_shriyan|LINK