•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 374,189 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,490 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 700 | Replies: 0
![]() |
| |
•
•
Join Date: Dec 2006
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
I have a checkbox inside a datalist control with Autopostback="True". When a user clicks the checkbox the associated event Handler is not firing.
My code is
In HTML :
In Code behind :
The checkboxclicked event Handler is not firing
Please help
Regards
Sanjish
My code is
In HTML :
ASP Syntax (Toggle Plain Text)
<asp:DataList ID="myDataList" runat="server" RepeatColumns="1" RepeatDirection="Vertical" > <ItemTemplate> <asp:CheckBox ID="chkid" runat="server" autopostback="True" /> <%#"Id " + Container.DataItem("CustomerID")%><br /> <%#"Name " + Container.DataItem("ContactName")%> <br /> <br /> </ItemTemplate> </asp:DataList>
In Code behind :
Protected Sub myDataList_ItemCreated(ByVal sender As Object, ByVal e As system.Web.UI.WebControls.DataListItemEventArgs) Handles myDataList.ItemCreated
Dim alSelectedValues As New ArrayList
For Each item As DataListItem In myDataList.Items
'check the item isn't a header or footer
If e.Item.ItemIndex > -1 Then
Dim cb As CheckBox = e.Item.FindControl("chkid")
AddHandler cb.CheckedChanged, AddressOf Me.checkboxclicked
Dim value As String = cb.Text
Dim checked As Boolean = cb.Checked
If checked Then
alSelectedValues.Add(value)
End If
End If
NextThe checkboxclicked event Handler is not firing
Please help
Regards
Sanjish
Last edited by peter_budo : May 10th, 2008 at 3:11 pm. Reason: Keep It Organized - please use [code] tags
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
Other Threads in the ASP Forum
- Previous Thread: how do I upload a file into the database from dreamweaver?
- Next Thread: Sql server express 2000


Hybrid Mode