943,793 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 667
  • ASP.NET RSS
Aug 3rd, 2009
0

checkboxlist

Expand Post »
hi !
i have made some code for a checkboxlist the items if are selected or not,and then to put them in my database.but im having a problem.even if i select my items they always apears unselected .
ASP.NET Syntax (Toggle Plain Text)
  1. Dim ckbox As ListItem
  2.  
  3. For Each ckbox In chbl.Items
  4. If ckbox.Selected = True Then
  5. objBLRegjistrimi.fnbooksubject(txtISBN.Text, chbl.SelectedValue)
  6. End If
  7. Next

'ckbox.selected' never becomes true,so never pass ' objBLRegjistrimi.fnbooksubject(txtISBN.Text, chbl.SelectedValue)'

i don't know why this happens.
thank you
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Nuela is offline Offline
3 posts
since Aug 2009
Aug 3rd, 2009
0

Re: checkboxlist

Change
If ckbox.Selected = True Then
to
If ckbox.Checked Then
I think that's what you want.

HTH
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Teme64 is offline Offline
1,024 posts
since Aug 2008
Aug 3rd, 2009
0

Re: checkboxlist

Click to Expand / Collapse  Quote originally posted by Teme64 ...
Change
If ckbox.Selected = True Then
to
If ckbox.Checked Then
I think that's what you want.

HTH
thank you but
checked' is not a member of 'System.web.Ui.Webcontrols.checkboxlist'
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Nuela is offline Offline
3 posts
since Aug 2009
Aug 3rd, 2009
0

Re: checkboxlist

If the applicaion is a web applicaion check to confirm that you are rebinding to the checkboxlist at every postback.
Reputation Points: 10
Solved Threads: 4
Newbie Poster
ema005 is offline Offline
24 posts
since Jan 2006
Aug 3rd, 2009
0

Re: checkboxlist

sorry i mean you need to confirm that you are not rebinding at every postback.
Reputation Points: 10
Solved Threads: 4
Newbie Poster
ema005 is offline Offline
24 posts
since Jan 2006
Aug 3rd, 2009
0

Re: checkboxlist

yes ,it is a web application.
sorry but what does it mean,because i dont understand what you want to tell me.can you explain me better
thank you
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Nuela is offline Offline
3 posts
since Aug 2009
Aug 3rd, 2009
0

Re: checkboxlist

If you are binding data to the checkboxlist at the page load and the code doing the binding is not within if not ispostback. The checkboxlist will never be selected.
Reputation Points: 10
Solved Threads: 4
Newbie Poster
ema005 is offline Offline
24 posts
since Jan 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: 404 error in subtext blog
Next Thread in ASP.NET Forum Timeline: ASP.Net Project





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC