User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,223 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 2,283 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.NET advertiser: Lunarpages ASP Web Hosting
Views: 562 | Replies: 1
Reply
Join Date: May 2008
Posts: 13
Reputation: sireesha.c is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
sireesha.c sireesha.c is offline Offline
Newbie Poster

check\uncheck all checkboxes in datalist control

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

 Protected Sub DataList8_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList8.ItemDataBound

        If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then

            Dim chkSelect As New CheckBox
            chkSelect = DirectCast(e.Item.FindControl("chkSelect"), CheckBox)

            chkSelect.Attributes.Add("onclick", "javascript:return Validate(this.name)")
        End If
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 5:16 pm. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2007
Posts: 257
Reputation: greeny_1984 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz in Training

Re: check\uncheck all checkboxes in datalist control

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

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 11:30 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC