Solved

checkbox not responding

Posted on 2009-05-07
5
192 Views
Last Modified: 2013-12-17
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
Comment
Question by:Mr_Shaw
  • 2
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
carlnorrbom earned 500 total points
ID: 24324235
Hi,

Have you enabled AutoPostBack="true"?

/Carl.
0
 
LVL 18

Expert Comment

by:carlnorrbom
ID: 24324246
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
 

Author Comment

by:Mr_Shaw
ID: 24324266
Nothing...my man nipple has more functionality
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 24324286
have you done any settings for  LearningPoints_Label.Visible  on Page_load

id yes then add it under Ispostback = false condition
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31578948
thanks... it was a postback issue
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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…

747 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