Reputation: 7325
I have created a user control and defined properties in order to pass values from .aspx page. As a next step I want to define values that a user control can accept in those properties.
For example if it is a property expecting a bool value, I want to be able to select either true or false, etc.
Not really sure how to start.
Upvotes: 0
Views: 205
Reputation: 13965
Your question is a little vague, but here goes:
All of this assumes discrete values. If you have a range of continuous values (-1.000 to 1.000, or something like that) you will probably need to write validation code in the Getter and Setter of your property. Another option would be to use DataAnnotations on your underlying model.
If you just need to know how to prevent bad data from being entered into a web control within your user control, you need to look into validation controls.
Upvotes: 2