?
Solved

using check box event to enable a button

Posted on 2005-04-13
1
Medium Priority
?
176 Views
Last Modified: 2010-04-07
private void CheckBox1_CheckedChanged(object sender, System.EventArgs e)
            {
                  if(CheckBox1.Checked)Button1.Enabled=true;
            }

AUTOPOST BACK IS TRUE.

I want to enable Button1 as soon as check box is checked
however no luck !

I am using C# in asp.net
0
Comment
Question by:deersuper
1 Comment
 
LVL 7

Accepted Solution

by:
ayha1999 earned 500 total points
ID: 13779230
Hi,

First disable button1 in pageload event, make checkbox's autopostback=true.

private void Page_Load(object sender, EventArgs e)
{
 if (!(Page.IsPostBack)) {
   Button1.Enabled = false;
 }
}

private void CheckBox1_CheckedChanged(object sender, System.EventArgs e)
{
 if (CheckBox1.Checked == true) {
   Button1.Enabled = true;
 } else {
   Button1.Enabled = false;
 }
}

hope this helps.

ayha
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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 …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

807 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