473,670 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checkbox Event Firing

Hi,
I have a Checkbox in a Repeater set to AutoPostBack = true. I have pointed
OnCheckedChange d to a Sub but it doesn't fire. If I move the checkbox out of
the Repeater it fires! Any ideas?
Thanks
Nov 18 '05 #1
3 4840
You need to wire the event during itemcreated or pageload, generally.

"Jack Turnbull" <tu***********@ ntlworld.com> wrote in message
news:6Z******** *****@newsfe5-gui.server.ntli .net...
Hi,
I have a Checkbox in a Repeater set to AutoPostBack = true. I have pointed
OnCheckedChange d to a Sub but it doesn't fire. If I move the checkbox out of the Repeater it fires! Any ideas?
Thanks

Nov 18 '05 #2
Nested controls usually don't raise their own events. I can think of a
couple of ways to handle this: neither is elegant, only one I have done
myself.

The one I have done is to put a hidden button (visible=false) on the page
and use Javascript on the checkbox to trigger a postback as if the hidden
control had been clicked. If you need to access the specific line that
had the checkbox clicked, I would put a button inside the ItemTemplate so
that you could respond to the repeater.ItemCo mmand event and get the line
item. Otherwise, you can put the button outside the repeater and trigger
it.

The other way I could think of is to loop though the repeater during
postback and find out if the checkbox has changed. Not very efficient at
all. You may want that for some very odd reason.

Heres a quick code snip:

<FooterTemplate >
<input type="checkbox" ID="cmdTriggerD elete" value="Delete"
OnClick="__doPo stBack('cmdDele te','click');" />
</FooterTemplate>
</asp:Repeater>

<asp:Button Runat=server ID="cmdDelete" Visible=false />

"Jack Turnbull" <tu***********@ ntlworld.com> wrote in
news:6Z******** *****@newsfe5-gui.server.ntli .net:
Hi,
I have a Checkbox in a Repeater set to AutoPostBack = true. I have
pointed OnCheckedChange d to a Sub but it doesn't fire. If I move the
checkbox out of the Repeater it fires! Any ideas?
Thanks


Nov 18 '05 #3
Thanks Guys,
I'll take the solution to wire a hidden button - I already have a button in
each row, I'll just hide it. The idea was to get rid of it to prevent the
user getting miffed at no update on clicking the button on a different row
to the checkbox change.
Thanks & Cheers

"Jack Turnbull" <tu***********@ ntlworld.com> wrote in message
news:6Z******** *****@newsfe5-gui.server.ntli .net...
Hi,
I have a Checkbox in a Repeater set to AutoPostBack = true. I have pointed
OnCheckedChange d to a Sub but it doesn't fire. If I move the checkbox out of the Repeater it fires! Any ideas?
Thanks

Nov 18 '05 #4

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

Similar topics

6
6435
by: AFN | last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear beneath the checkbox, pushing the rest of the page down. And when unchecking the checkbox, the paragraph should disappear and the part below should push back up again. How?
2
3862
by: alien2_51 | last post by:
Can some one tell me why the onclick is firing twice for the radion button and checkbox controls...? <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Testing.aspx.vb" Inherits="CustomerRelations.Testing" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Testing</title> <!--
5
3114
by: Greg Hurlman | last post by:
I've got a very simple ASCX page, where once someone finishes a section and clicks the "Next >" button, the section they just finished is disabled, and the next section appears below it, and so on. One of the controls is a checkbox, which, when clicked, displays a hidden panel containing controls whose input are used for filtering query results. If someone checks the checkbox in the first section and clicks the first "Next >" button,...
3
2022
by: DotNetJunkies User | last post by:
Hi, I have a checkbox control programmatically created for each row in the datagrid but CheckedChanged event not firing when state of the checkbox changes. I use the following code to instantiate ItemTemplate with checkbox contructor: public class TemplateObject : ITemplate { public void InstantiateIn(Control objContainer) { CheckBox objCheckBox = new CheckBox(); objCheckBox.ID = "Item";
5
3363
by: tshad | last post by:
Is there a way to allow a user to press a radio button if it is already selected? There is an onCheckedChanged event that fires when the person presses the button and it is isn't selected already. If it is selected, it doesn't fire. This isn't the case with a checkbox. The event fires whether the control is already checked or not. Thanks,
1
1223
by: rodchar | last post by:
hey all, is the following even possible? i have a datagrid with checkboxes on each row, when a user clicks on the checkbox i'd like to populate one of the fields in the grid with the current date. how would i do that?
2
10777
by: dilip.movva | last post by:
Hi, In the ItemDataBound of my datagrid I am creating a checkbox dynamically. I have the eventhandler defined for CheckedChanged of the check box. The event is not firing. The grid is bound in the Page_Prerender method. My code is something like this Private Sub grdMissingData_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles grdMissingData.ItemDataBound If e.Item.ItemType =...
2
1827
by: Deano | last post by:
I have a subform that is populated by a table that holds lots of yes/no values. The user sees points at the side and then periods across the top. So they decide they want point 20 for period 5 and go click that checkbox. This in turn fires of various calculation code in the After_Update event of the checkbox. This all works rather well. I now need to check a given checkbox using code. I'm attempting to create a recordset based on...
4
4272
by: sarabonn | last post by:
Hello everyone, Iam firing a event in the chechbox_checkedchanged. It works fine private void checkBox1_CheckedChanged(object sender, EventArgs e) { / textBox1.Visible = false; textBox2.Visible = false; button2.Visible = false;
0
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8813
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7412
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1791
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.