then the output CSS class will be HighlightedBackgroundCheckbox because
a RadioButton is a Checkbox.
Simple fix is to check its a radiobutton first.
namespace System.Web.UI.WebControls
public class RadioButton : CheckBox
foreach (string boundNameToCompare in boundNames)
{
CheckBox cb =
this.FindControl(this.TargetControlID) as CheckBox;
if (cb != null)
{
cb.CssClass = "HighlightedBackgroundCheckbox";
continue;
}
RadioButton rb =
this.FindControl(this.TargetControlID) as RadioButton;
if (rb != null)
{
rb.CssClass = "radio HighlightedBackground";
continue;
}
}
No comments:
Post a Comment