473,326 Members | 2,182 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,326 software developers and data experts.

CheckBox CheckChanged Event

I have two checkboxes on a form. I changed the Autopostback to "true".
I code for the check change event. When I click one of the checkboxes,
it does perform the Page load event, but does not perform the Check
Change event.

I do not see in the windows generated code (C#) that it generated the
code "register" of the event. Should I? I am using VS.Net, and I would
have thought it would of registered the event. How do I get the event
registered, or is that even my problem?

I added the code for the event as follows....

I first Double click on the Event and that created the "method pattern".
I then changed the name of this method, as I was going to call it from
several places. I then went back in the IDE and pasted the new name
there in all of the controls that I needed the method for...

Thanks in advance for your assistance!!!!!!!!!
Nov 18 '05 #1
3 2410
Do you handle !IsPostBack. For post back to work you must handle all the
initialization of the page in if(!IsPostBack)
Shimon
"Jim Heavey" <JH*****@nospam.com> wrote in message
news:Xn*************************@207.46.248.16...
I have two checkboxes on a form. I changed the Autopostback to "true".
I code for the check change event. When I click one of the checkboxes,
it does perform the Page load event, but does not perform the Check
Change event.

I do not see in the windows generated code (C#) that it generated the
code "register" of the event. Should I? I am using VS.Net, and I would
have thought it would of registered the event. How do I get the event
registered, or is that even my problem?

I added the code for the event as follows....

I first Double click on the Event and that created the "method pattern".
I then changed the name of this method, as I was going to call it from
several places. I then went back in the IDE and pasted the new name
there in all of the controls that I needed the method for...

Thanks in advance for your assistance!!!!!!!!!

Nov 18 '05 #2
In the code-behind page, there should be a Web Form Designer generated code
section containing a method:

private void InitializeComponent()

And in that method, you need to register the checkChanged event, like this:
this.chkMyCheck.CheckedChanged += new
System.EventHandler(this.chkMyCheck_CheckedChanged );

Hope that helps!
"Jim Heavey" <JH*****@nospam.com> wrote in message
news:Xn*************************@207.46.248.16...
I have two checkboxes on a form. I changed the Autopostback to "true".
I code for the check change event. When I click one of the checkboxes,
it does perform the Page load event, but does not perform the Check
Change event.

I do not see in the windows generated code (C#) that it generated the
code "register" of the event. Should I? I am using VS.Net, and I would
have thought it would of registered the event. How do I get the event
registered, or is that even my problem?

I added the code for the event as follows....

I first Double click on the Event and that created the "method pattern".
I then changed the name of this method, as I was going to call it from
several places. I then went back in the IDE and pasted the new name
there in all of the controls that I needed the method for...

Thanks in advance for your assistance!!!!!!!!!

Nov 18 '05 #3
Thanks
Nov 18 '05 #4

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

Similar topics

0
by: Jim Heavey | last post by:
Hello, I am trying to understand how events work when I place a Checkbox control into a datagrid. When I added it, I set the "OnCheckedChanged" property to "CheckItIn", thinking that this would be...
2
by: bebop | last post by:
I'm using three checkbox web controls in C# .NET and one button, and one labe Is there a way to "group" these individual checkbox web controls If so, do I use a for loop, hashtable, array,...
5
by: fred | last post by:
hiya, I have got a checkbox in one of my cells in the ediit item template. Now i need to enable/disable a textbox in another boundcolumn. the problem i am facing is the checkchanged event is...
7
by: Lars Netzel | last post by:
If I put a checkbox in a datagrid (ASP.NET) and set the Autopostback to true I can catch OnChange event on checkbox but how do I then catch what DataGridItemIndex is? Can I use some Event in the...
2
by: Javier | last post by:
Hi Everyone, I have a dynamic checkbox in a datagrid that uses the ITemplate interface and has the checkchanged event wired up. When the checkbox is checked, the event event handler that...
4
by: UJ | last post by:
I've got an page that dynamically generates a table (don't ask!) that includes in each cell a checkbox. I can get the checkbox create but I can't figure out how to get an event tied to it so that...
0
by: rn5a | last post by:
I have a DataGrid where in the first column of each row is a CheckBox (the CheckBoxes reside in the TemplateColumn of the DataGrid). The CheckBox's AutoPostBack property is set to True & its...
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
2
by: =?Utf-8?B?UmljaA==?= | last post by:
Is there a cancel argument for cancelling if you want to check or uncheck a checkbox? In the checkChanged event of a checkbox I ask the user if they are sure they want to check/uncheck...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.