473,587 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeater Control Question

Z D
Hello,

I have a checkbox control as one of the items within my repeater control.

I've set the AutoPostBack=Tr ue on the checkbox.

How do I access the event (so that I can run some code) whenever someone
clicks on the checkbox? Also, how do I determine which checkbox was clicked
so that I can run the appropriate code?

thanks in advance,
-ZD

Nov 18 '05 #1
1 1402
I recently did a similar task with a repeater. When using a repeater, it
will rename the controls within it so they have uniqe ID's.
Here's a basic example:

RepeaterName__c trl00_ControlNa me

ctrl00 is how many times it's looped through.

I had a button within a repeater, and this is how I found out what buttons
was pressed:
<asp:button cssclass="BoxTy pe42" value="Allow" id="btnAllow" name="Allow"
Text="DisAllow" onclick="Switch Item" runat="server" />

Code Behind:

Public Sub SwitchItem(ByVa l sender As System.Object, ByVal e As
System.EventArg s)
'**Let's say the item passed in was Repeater1__ctrl 01_btnSubmit
Dim btnTest As New Button
Dim astrTest As String()
btnTest = CType(sender, Button)
astrTest = btnTest.ClientI D.Split("_")
strControlsToEd it = astrTest(2)
....
End Sub

At the end, strControlsToEd it will contain ctrol01 (telling me what loop to
look for if I need to edit anything special within that one section of the
repeater).
astrTest(3) will give you "btnSubmit" .
If you need to loop through all items, look at the post started on July 23,
2004 by me and read the responses to it.

Hope this helps.

Ryan Ternier
Code Monkey

"Z D" <NO****@NOSPAM. com> wrote in message
news:OV******** ******@TK2MSFTN GP11.phx.gbl...
Hello,

I have a checkbox control as one of the items within my repeater control.

I've set the AutoPostBack=Tr ue on the checkbox.

How do I access the event (so that I can run some code) whenever someone
clicks on the checkbox? Also, how do I determine which checkbox was clicked so that I can run the appropriate code?

thanks in advance,
-ZD

Nov 18 '05 #2

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

Similar topics

1
2313
by: Fraggle | last post by:
I have a repeater with controls added at run time. the <template> also contains a <asp:textbox that is made visible on some repeater elements. when I come to read the text info out it has disapeared. The read is done on a button click. I can read the selected items from the other controls in the repeater, demo page here
8
4268
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue which is related to the repeater. In the code shown below, if I call Repeater1.Controls.Count in the OnInit (the code fragment was highlighted in...
4
4134
by: MattB | last post by:
This is just a rephrased version of a question I posted earlier. I think I'm closer now, so it seemed worthy of a new (more specific) post. In my repeater I'm dynamically creating text boxes, so at compile time I don't know what text boxes are going to be present at run time. This is where it seems the FindControl method would be come into...
1
5421
by: olduncleamos | last post by:
Hello all, I am experimenting with the repeater control and ran into something that I wasn't expecting. I would appreciate if the experts can confirm or correct my understanding. Here is a fragment of a very simple page that I wrote that will drill down into the displayed item. The result is to be display on the same page so that the...
7
5473
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the Repeater control, I've placed DropDownLists and CheckBoxes. When the user has updated the information, he/he clicks the submit button which is outside...
3
2103
by: Andrew | last post by:
Hi, I am working on a questionnaire. I have displayed a questionnaire using a repeater control. The itemtemplate is as below (quite cut down): <ItemTemplate> <tr><td> <%# DataBinder.Eval(Container.DataItem, "question")%> </td></tr> <tr><td>
4
7410
by: sck10 | last post by:
Hello, I have a repeater that is bound to a SQL Server table. I would like to place a summary in the footer for the item count and product cost. I have two fields. One for the product name and the other for product cost. <%#Container.DataItem("ProductA")%> <%#Container.DataItem("PriceA")%>
9
4680
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate> /asp:Repeater> The DataSource for this Repeater is a CollectionBase of objects and is
7
2998
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm attempting to bind a user control I've written, "ImageBox", to a repeater. The user control takes a custom property, "ContentID", that will execute...
12
2156
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a test page and I've managed to bind the usercontrol to a repeater and display some data in the following fashion: <asp:Repeater ID="Repeater1"...
0
8206
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. ...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6621
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...
0
5392
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...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
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
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
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...

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.