check\uncheck all checkboxes in datalist control

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 17
Reputation: sireesha.c is an unknown quantity at this point 
Solved Threads: 0
sireesha.c sireesha.c is offline Offline
Newbie Poster

check\uncheck all checkboxes in datalist control

 
0
  #1
Jul 18th, 2008
check\uncheck all checkboxes in datalist control in asp.net with vb.

  1. Protected Sub DataList8_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList8.ItemDataBound
  2.  
  3. If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
  4.  
  5. Dim chkSelect As New CheckBox
  6. chkSelect = DirectCast(e.Item.FindControl("chkSelect"), CheckBox)
  7.  
  8. chkSelect.Attributes.Add("onclick", "javascript:return Validate(this.name)")
  9. End If
  10. end sub


getting error in chkSelect.Attributes.Add("onclick", "javascript:return Validate(this.name)")

Object reference not set to an instance of an object.


give me the suggesion where i have to update my code
Last edited by Tekmaven; Jul 18th, 2008 at 6:16 pm. Reason: Code tags
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: check\uncheck all checkboxes in datalist control

 
0
  #2
Jul 19th, 2008
chkselect check box doesnt exists,so u are getting the error.Whats directcast
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC