Solved

checkbox not responding

Posted on 2009-05-07
5
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

717 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