Last active
August 29, 2015 14:05
-
-
Save azechi/fe76877e88a4d1394f66 to your computer and use it in GitHub Desktop.
CheckBoxControl.InputAttributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="form1" runat="server"> | |
<div> | |
<asp:checkbox runat="server" id="checkbox" oninit="checkbox_Init" /> | |
<asp:button runat="server" /> | |
</div> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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