?
Solved

checkbox not responding

Posted on 2009-05-07
5
Medium Priority
?
205 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 2000 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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

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 …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

770 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