ASP.Net RadioButton and CheckBox css class render inside a Span Fixed

Posted by Unknown On Thursday, January 8, 2015 0 comments

Problem: when we add cssclass to asp.net checkbox control, it renders checkbox control in span tag. That not what we want.

Solution: call InputAttributes function

C#
protected override void OnPreRender(EventArgs e)
{
        if (!Page.IsPostBack)
        {
            chkMenuItem.InputAttributes.Add("class", "selectall");
        }
}

0 comments:

Post a Comment