Skip to content

Instantly share code, notes, and snippets.

@azechi
Last active August 29, 2015 14:05
Show Gist options
  • Save azechi/fe76877e88a4d1394f66 to your computer and use it in GitHub Desktop.
Save azechi/fe76877e88a4d1394f66 to your computer and use it in GitHub Desktop.
CheckBoxControl.InputAttributes
<form id="form1" runat="server">
<div>
<asp:checkbox runat="server" id="checkbox" oninit="checkbox_Init" />
<asp:button runat="server" />
</div>
</form>
private void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
checkbox.InputAttributes.Add("x-data", "!");
}
}
private void checkbox_Init(object sender, EventArgs e)
{
var _ = checkbox.InputAttributes;
}
public class MyCheckBox : CheckBox
{
protected override void OnInit(EventArgs e)
{
var _ = this.InputAttributes;
base.OnInit(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment