Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

checkbox not responding

I have a checkbox which I would like to use to show and hide other objects on the web page.

my code is


protected void altService_checkbox_CheckedChanged(object sender, EventArgs e)
    {
        #region show and hide alternative service lables and text boxes through the checkbox.
        if (altService_checkbox.Checked == true)
        {
            LearningPoints_Label.Visible = true;
        }
        else if (altService_checkbox.Checked == false)
        {
            LearningPoints_Label.Visible = false;
        }
        #endregion
}

When I check the checkbox nothing happens.

I am using c# and asp.net

can anybody help

thanks
0
Mr_Shaw
Asked:
Mr_Shaw
  • 2
  • 2
1 Solution
 
carlnorrbomCommented:
Hi,

Have you enabled AutoPostBack="true"?

/Carl.
0
 
carlnorrbomCommented:
Hi,

Forgot to say it's the AutoPostBack property of the CheckBox, you can set it either declaratively:

<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true"/>

Or in code behind:

CheckBox1.AutoPostBack = true;

/Carl.
0
 
Mr_ShawAuthor Commented:
Nothing...my man nipple has more functionality
0
 
Pratima PharandeCommented:
have you done any settings for  LearningPoints_Label.Visible  on Page_load

id yes then add it under Ispostback = false condition
0
 
Mr_ShawAuthor Commented:
thanks... it was a postback issue
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now