In my code-behind I tried to set the CssClass property of a
Microsoft.SharePoint.WebControls.BooleanField field during Page_OnLoad.
During a debug session I could find out, that this control's CssClass property is "ms-input" by default.
I overwrote it by different class name.
This field gets rendered on the page like this:
<TD class="ms-formbody No-Borders" vAlign=top align=middle><SPAN dir=none><INPUT id=ctl00_m_g_6796b238_94c6_47ff_bf38_ca66daa7a0d5_ctl00_AlertFormContent1_ConfirmationField_ctl00_BooleanField title="Quality Confirmation" type=checkbox name=ctl00$m$g_6796b238_94c6_47ff_bf38_ca66daa7a0d5$ctl00$AlertFormContent1$ConfirmationField$ctl00$BooleanField><BR></SPAN></TD>
As you can see SharePoint actually does not render any CSS class style on this input field type.
I am wondering why the CssClass is available and set by a default value although it does not get rendered.
I would like to know why this control behaves like this. Is this intentionally or a bug?
Maybe one of you out there has an answer to this.
Microsoft.SharePoint.WebControls.BooleanField field during Page_OnLoad.
During a debug session I could find out, that this control's CssClass property is "ms-input" by default.
I overwrote it by different class name.
This field gets rendered on the page like this:
<TD class="ms-formbody No-Borders" vAlign=top align=middle><SPAN dir=none><INPUT id=ctl00_m_g_6796b238_94c6_47ff_bf38_ca66daa7a0d5_ctl00_AlertFormContent1_ConfirmationField_ctl00_BooleanField title="Quality Confirmation" type=checkbox name=ctl00$m$g_6796b238_94c6_47ff_bf38_ca66daa7a0d5$ctl00$AlertFormContent1$ConfirmationField$ctl00$BooleanField><BR></SPAN></TD>
As you can see SharePoint actually does not render any CSS class style on this input field type.
I am wondering why the CssClass is available and set by a default value although it does not get rendered.
I would like to know why this control behaves like this. Is this intentionally or a bug?
Maybe one of you out there has an answer to this.
Hi Andreas,
ReplyDeleteDid you ever find a solution to this? I'm having the same issue, with both BooleanFields and DropDownChoiceFields. TextFields do render CssClass properly, though.