OnCheckChanged event not firing.

Posted on 2009-04-20
Last Modified: 2012-05-06

Not sure exactly what is wrong, but I can't seem to get the "OnCheckChanged" event to fire when clicking on a checkbox or a radiobutton.  I was having this trouble is a current website I was working on, so I decided to make a whole new website with nothing on it except for a checkbox and a radiobutton to test.  The new website didn't work either.  Attached is the complete code.  Maybe you guys could see something I've missed
/***** Web Form *****/

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">

<head runat="server">

    <title>Untitled Page</title>



    <form id="form1" runat="server">


        <asp:RadioButton ID="RadioButton1" runat="server" Text="Radio1" 

            OnCheckedChanged="RadioButton1_CheckedChanged" />

        <br />

        <br />

        <asp:CheckBox ID="CheckBox1" runat="server" Text="Check1" 

            OnCheckedChanged="CheckBox1_CheckedChanged" />    

        <br />

        <br />

        <asp:Label ID="Label1" runat="server" ForeColor="Red" Font-Bold="true" />





/***** Code Behind *****/

using System;

using System.Configuration;

using System.Data;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 


    protected void Page_Load(object sender, EventArgs e)



    protected void RadioButton1_CheckedChanged(object sender, EventArgs e)


        Label1.Text = "Radio was clicked";


    protected void CheckBox1_CheckedChanged(object sender, EventArgs e)


        Label1.Text = "Checkbox was clicked";



Open in new window

Question by:P1ST0LPETE
    LVL 39

    Accepted Solution

    I don't see a button or something, should I assume that you expect the checkedChanged event to fire when clicking the checkbox? If so, you should set the AutoPostBack value for the checkbox and you will be fine.
    LVL 10

    Author Closing Comment

    OMG, I am such a noob.  I forgot about the AutoPostBack property.
    Thanks for the help.
    LVL 39

    Expert Comment

    > OMG, I am such a noob.  > Thanks for the help.
    happens to all of us, sometimes you can just stare and stare and still not seeing it.... Glad I could be of help :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now