5

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?

3 Answers 3

10

I believe it is CheckedChanged.

Sign up to request clarification or add additional context in comments.

Comments

6

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
}

Comments

1

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) {}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.