473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

OnCheckedChanged Not Firing?

Odd thing: if I check the checkbox, the code works fine. If I uncheck
the checkbox, I get nothing, not even the "Executed" that's supposed to
show up (as you'll see in the code).

Thanks for any help!

-Brent

On the page I have:

===================
<asp:CheckBox ID="cbSelectAll" AutoPostBack=true
OnCheckedChanged="selectAll" runat=server />

(plus a repeater named "repMsgList")
===================

The code that's supposed to execute:

===================

void selectAll(Object Sender, EventArgs e)
{
Response.Write("Executed");
CheckBox cMain = (CheckBox)Sender;
bool cbControl = cMain.Checked ? true : false;

foreach (RepeaterItem ri in repMsgList.Items)
{
if (ri.ItemType == ListItemType.Item || ri.ItemType ==
ListItemType.AlternatingItem)
{
CheckBox cb = (CheckBox)ri.FindControl("cb");
cb.Checked = cbControl ? true : false;
}
}

}

Jul 4 '06 #1
1 10499
Raj
check if it going in Page_LOad event and PostBack part is working....

Raj

"wr********@gmail.com" wrote:
Odd thing: if I check the checkbox, the code works fine. If I uncheck
the checkbox, I get nothing, not even the "Executed" that's supposed to
show up (as you'll see in the code).

Thanks for any help!

-Brent

On the page I have:

===================
<asp:CheckBox ID="cbSelectAll" AutoPostBack=true
OnCheckedChanged="selectAll" runat=server />

(plus a repeater named "repMsgList")
===================

The code that's supposed to execute:

===================

void selectAll(Object Sender, EventArgs e)
{
Response.Write("Executed");
CheckBox cMain = (CheckBox)Sender;
bool cbControl = cMain.Checked ? true : false;

foreach (RepeaterItem ri in repMsgList.Items)
{
if (ri.ItemType == ListItemType.Item || ri.ItemType ==
ListItemType.AlternatingItem)
{
CheckBox cb = (CheckBox)ri.FindControl("cb");
cb.Checked = cbControl ? true : false;
}
}

}

Jul 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: qaz | last post by:
For some reason my global.asa file is not firing. I have it located in the root of my website (e.g., wwwroot\mywebsite\global.asa) and I have the web site configured as an "application" in IIS. ...
0
by: Maziar Aflatoun | last post by:
Hi everyone, I am reading and displaying data rows from my database where the first column contains the Status checkbox. I like to enable my users to change the status of individual rows by...
2
by: Homa | last post by:
Hi, I have a Datagrid that uses as a shopping cart and have a checkbox template column in it. I can't add both OnCheckedChanged Event and onclick client script for it. I want to do two...
2
by: Maziar Aflatoun | last post by:
Hi everyone, I am reading and displaying data rows from my database where the first column contains the Status checkbox. I like to enable my users to change the status of individual rows by...
3
by: theycallmetish | last post by:
hey. i'll get right into it. i've got a codebehind page and m presentation page. i've got this code for my checkbox, which in theor is supposed to (when checked) take the first and last name of th...
4
by: Assimalyst | last post by:
Hi, I have a AutoPostBack checkbox and need to set a value bSubmitted = true when the checkbox is checked in order to prevent a warning message appearing notifying the user they are navigating...
19
by: furiousmojo | last post by:
This is a strange problem. I have a project where the contents of global.asax application_error are not firing. It is an asp.net 2.0 application using web application projects. I have another...
2
by: Mufasa | last post by:
How can I make an asp:radiobutton where when the user selects it it runs javascript code? I've tried doing the following but it doesn't seem to work: ...
1
by: Danielle | last post by:
Greetings all and thanks in advance for any help you can provide. I am trying ultimately to get values from a gridview row when a checkbox on the row is checked. the problem I'm having is that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.