private string _itemId;
[Browsable(true),
Description("Required identifier for the Item.")]
public string ItemId
{
get { return _itemId; }
set
{
if (string.IsNullOrEmpty(_itemId))
{
_itemId = value;
}
}
}
How would I actually make that required when someone uses the control? I’m trying to find an attribute that says something like Required(true).
I don’t know that there’s an attribute for this. I believe on the Page_Load event (or perhaps some rendering event) just check if the value has been set. If not then throw an exception.