What do you think about casting or converting using as? For example, should I use this one?
CheckBox cbStatus = sender as CheckBox ;
Or this one?
CheckBox cbStatus = (CheckBox)sender;
What do you think about casting or converting using as? For example, should I use this one?
CheckBox cbStatus = sender as CheckBox ;
Or this one?
CheckBox cbStatus = (CheckBox)sender;
If you do “as”, then always check for null. If you are sure of the type which is returned, then simply cast it instead of doing “as”. “As” can return null