1

The CheckBox dosen't trigger oncheckedchanged event:

<asp:CheckBox ID="ccCritica" runat="server" 
                                style="z-index: 1; right: 15px; top: 100px; position: absolute" 
                                oncheckedchanged="ccCritica_CheckedChanged" />

.

protected void ccCritica_CheckedChanged(object sender, EventArgs e)
{
    if(ccCritica.Checked == true)
    {
        ddSarcinaDep.Enabled = true;
    }
}

I've tried with debug and it dosen't call the eventhandler.I'm using Visual Studio 2010 professional, and I'm Developing an ASP.NET Web application.Thanks

4

2 に答える 2

8

Set AutoPostBack="true" in aspx

于 2012-07-10T13:40:39.277 に答える
0

Use the following code:

<asp:CheckBox ID="ccCritica" runat="server" style="z-index: 1; right: 15px; top: 100px; position: absolute" AutoPostBack="true"
                            oncheckedchanged="ccCritica_CheckedChanged" />

    protected void ccCritica_CheckedChanged(object sender, EventArgs e)
    {
        if (ccCritica.Checked == true)
        {

            ccCritica.Enabled = true;
        }
    }
于 2012-07-10T14:09:33.933 に答える