mercredi 18 mai 2016

ASP.NET Webforms Checkbox event sending argument

I basically have a lot of checkboxs calling the same function. To identify the action that it each one is suppose to trigger, I was thinking on passing an argument for the function that is going to be triggered.

My checkbox is as this:

<asp:CheckBox ID="checkBoxRegul" runat="server" CssClass="" Visible="false" OnCheckedChanged='checkBoxRegularizarChangedEvent' AutoPostBack="True" />

My function is as this:

protected void checkBoxRegularizarChangedEvent(object sender, EventArgs e)
{
    CheckBox cb = (CheckBox)sender;
}

How can I send and receive information via EventArgs?

Thanks!




Aucun commentaire:

Enregistrer un commentaire