Set the AutoPostBack property to true will make CheckBox cause an automatic PostBack - ASP.NET

Q.  Clicking a CheckBox does not cause an automatic PostBack. How do you make the CheckBox cause an automatic PostBack?
- Published on 28 Jul 15

a. Set the AutoPostBack property to true.
b. Add JavaScript code to call the ForcePostBack method.
c. Set the PostBackAll property of the Web Page to true.
d. None of the above

ANSWER: Set the AutoPostBack property to true.
 

    Discussion

  • Brijesh   -Posted on 19 Oct 15
    Set the AutoPostBack property to true.
    By default AutoPostBack property of CheckBox control is false, so the event related to checkbox will not work. You have to Set the AutoPostBack property to true. It enables you to post the web form back to the server automatically when the CheckBox is checked .
    Example:
    < asp:CheckBox ID="CheckBox1" runat="server" oncheckedchanged="CheckBox1_CheckedChanged" AutoPostBack="true"
    />

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)