CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 6/4/2004 8:54:53 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 11 Views: 194 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
12 Items, 1 Pages 1 |< << Go >> >|
pietaster
Asp.Net User
CheckBox CheckedChanged event wont fire6/4/2004 8:54:53 PM

0/0

I am having such a problem with this. When I uncheck my checkbox I want the CheckedChanged event to fire but it wont.

this is in my InitalizeComponent

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.cbSystem.CheckedChanged += new EventHandler(cbSystem_CheckedChanged);
}

this is my event

private void cbSystem_CheckedChanged(object sender, EventArgs e)
{
Response.Write("WooHoo!!!!");
}

here is the HTML for the control

<asp:CheckBox id="cbSystem" runat="server" CssClass="fdata" Checked="True" Text="This is a test" AutoPostBack="True">


This event is never called.

What am I doing wrong please help.




pietaster,

A jury consists of twelve persons chosen to decide who has the better lawyer.
- Robert Frost (1874 - 1963)
pietaster
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/7/2004 1:14:41 PM

0/0

No one can tell me why this event wont fire? Another bug in .Net. With all of these bugs it makes it difficult to program.
pietaster,

A jury consists of twelve persons chosen to decide who has the better lawyer.
- Robert Frost (1874 - 1963)
AndrewSeven
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/7/2004 3:24:15 PM

0/0

Is InitializeComponent() called?
Does the page postback?
Does the event wor if you specify it in the html attributes?
pietaster
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/7/2004 5:22:54 PM

0/0

Yes the InitalizeComponent() is called. no to the others.

pietaster,

A jury consists of twelve persons chosen to decide who has the better lawyer.
- Robert Frost (1874 - 1963)
AndrewSeven
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/7/2004 5:43:01 PM

0/0

Can you post the aspx and codebehind.
pietaster
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/7/2004 8:05:30 PM

0/0

The very first message of this thread has my code. Is there anything in particular you are looking for?

pietaster,

A jury consists of twelve persons chosen to decide who has the better lawyer.
- Robert Frost (1874 - 1963)
AndrewSeven
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/7/2004 9:12:37 PM

0/0

I'm looking for the smallest reproduceable example so I don't have to type it up myself ;)
pietaster
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/9/2004 3:55:00 PM

0/0

I am working on multiple projects at the same time, In another project I am having the same problem. I added to dropdownlists that do autopostback and now my submit button does not work.

Is there something Im missing? Are you not allowed to have multiple controls have autopostback on the same form???????


this is drving me nuts.

pietaster,

A jury consists of twelve persons chosen to decide who has the better lawyer.
- Robert Frost (1874 - 1963)
AndrewSeven
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/9/2004 4:00:21 PM

0/0

I asked what seemed to be the obvoius questions and I'm not really busy at the moment, so ...

If you can create a small example that illustrates the problem and post it here I will try to figure it out.

(You can have multiple autopostback controls
master4eva
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/9/2004 5:13:47 PM

0/0

To put the answer in a nutshell, yes -- it is a bug by design. The reason is a rather lengthy one but the "bug by design" was to avoid another bug. What you can do is have a look at this example (listed at the bottom of the page) and see how they got the deselect to work:

http://authors.aspalliance.com/aspxtreme/aspnet/syntax/checkboxwebcontrol.aspx

And on top of that, you could create a new web control that will not have the design bug... I could whip up some code but not now: I am a bit busy.
-- Justin Lovell
AndrewSeven
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/9/2004 7:34:11 PM

0/0

Now I'm confused.

I have this in my markup : <asp:CheckBox id="cbSystem" runat="server" CssClass="fdata" Checked="True" Text="This is a test" AutoPostBack="True" />

And this in code:



#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.cbSystem.CheckedChanged += new System.EventHandler(this.cbSystem_CheckedChanged);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
private void cbSystem_CheckedChanged(object sender, System.EventArgs e)
{
Response.Write("<BR>HERE" + ((CheckBox)sender).Checked);
}




It certainly seems to postback , fire the event and write the correct state of checked.
joteke
Asp.Net User
Re: CheckBox CheckedChanged event wont fire6/10/2004 6:11:37 AM

0/0

Yes, it should work just fine. Can you pietaster clarify what you meant with:
now my submit button does not work.

Please describe how you are using the control on the Page. Do you mean that when you click submit button (not checkbox itself) CheckedChanged won't fire?
Thanks,

Teemu Keiski
Finland, EU
12 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
vbCity/DevCity.NET Forums :: FAQ :: .NET :: ASP.NET :: Web Development This FAQ will show how to trap the CheckedChanged event of checkbox control in ..... the page closing event won't fire if the user switches off their PC! ...
checkbox, checkedchanged event, & javascript - ASP.NET Forums Re: checkbox, checkedchanged event, & javascript ... called if the user clicks cancel... otherwise it lets the script emitted by the AutoPostback fire! ...
CodeProject: Adding a CheckBox column to your DataGrid. Free ... It was recently asked if it was possible to receive the CheckedChanged event from the CheckBoxes that were contained within the column. ...
Checkbox custom control doesn't fire event when unchecked : ASP ... So it will not get fire once check box get unchecked. ... to true both the check and uncheck event should trigger the CheckedChanged event. ...
Problem with dynamically adding checkboxes to a datagrid. - ASP ... I've been having problems with dynamically adding a checkbox to a datagrid. ... template columns to the Page_Init, my checkbox oncheckedchanged event won't fire . ... Add(box); } public event EventHandler CheckedChanged; private void ...
How to use a checkbox in a datagrid template column. I am new to this but my Check_Clicked event will not fire ... any ideas why check_clicked won't fire? # re: How to use a checkbox in a .... a custom event that was fired from the CheckBox's "CheckedChanged" event which is built in. ...
.NET csharp Event handlers I assign a new event hander to the checkbox checkedchanged event to a ... Very simple, it wont go dead in the first place :) you are not holding a refeernce to it directly, but the instance that will fire the event does. ...
Events in the CAB (Introduction to CAB/SCSF Part 12) « Rich Newman If we try to add a subscription that already exists then the CAB won’t throw an ... We don’t need to explicitly call the Fire event of the EventTopic. ... This is achieved with the code below in the CheckedChanged event of the checkbox: ...
order of events - dynamic checkbox events CheckBox cb = new CheckBox(); cb.AutoPostBack=true; cb.CheckedChanged += new System. ... ASP.NET Javascript Modal Popup won't fire Page Load on second go ... Order of events problem with dynamic checkbox. Please help! ...
vbCity/DevCity.NET Forums :: .NET :: ASP.NET :: Checkbox inside ... Checkbox inside datalist - Event Handler not firing ... while it may work locally (not sure), it won't work remotely. ... were unchecked on every post and the checkedchanged event was not firing . But now there is another problem . The very first checkbox does not fire whereas the others do. ...




Search This Site:










getting roles from context.user

dotnetnuke news module enhancement: limiting the number of news items

menu - graphics shift when using large font

is it ture that internet explorer web controls are no longer supported???

conflicting login controls preventing submission of login information

visual source safe & dnn

images not displayed in debug mode

image tables?

form and window authenticate

how to install ie web controls in asp.net2.0

dynamic welcome message

performance, multiple modules on one page

retrieving records based on user.identity.name

dnn3.1.0-crashed due to skin

login page problem - not redirecting properly. help!

portal alias in dnn4.0.1

itemplate collection

distance between two webparts?

stop redirecting to login page

anyone using google adsense

data application block question

visual web developer makes makes system slow..

installation issues

updated module: football bowl pool (dnn 3.x)

service pack release...

url rewriting

error after upgrade from 3.1.0 to 3.1.1

how to?? change email text from the portal..

"page.clientscript" does not compile in assembly

change treeview default plus and minus sign

 
All Times Are GMT