views:

2721

answers:

3

What is the EventName property when I set up a ASP.NET checkbox control as an async postback trigger for an asp.net update panel?

A: 

OnCheckedChanged is the event name. You can autogenerate the method by double clicking the checkbox in the UI, and based on the checkbox name it will generate the method which will most likely be:

protected void CheckBox1_OnCheckedChanged(object sender, EventArgs e) {}
achinda99
+1  A: 

All you have to do is set AutoPostback to true and if your CheckBox is within the UpdatePanel you shouldnt have any problems

<asp:CheckBox runat="server" ID="chk_Name" AutoPostBack="true" OnCheckedChanged="chk_Name_OnCheckedChanged"></asp:CheckBox>

Then in the OnCheckedChanged function you can do whatever you need to do

protected void chk_Name_OnCheckedChanged(object sender, EventArgs e) 
{
     // Do stuff here
}
jmein
+1  A: 

I believe it is CheckedChanged.

Jakob Christensen