Checkbox in ListBox

E

Edmilson

Hello All

I have a Datalist where each "Item" contains a checkbox (among other
things). I want the user to be able to click on one or more
checkboxes, click the Send button, and have something done to the
Items that had the check boxes selected. Seems like a common task. I
was easily able to do something like this in classic ASP. But I'm
lost in ASP.NET.

I´m using VB and I hope you can point me in the right direction...

tks all
troqui
 
C

Charlie Nilsson [MSFT]

You might try something like this, in your event handler or IsPostBack
section of your Page_Load...

For Each obj In dlist.Items
If obj.GetType Is System.Web.UI.WebControls.CheckBox Then
checkbox = CType(obj,
System.Web.UI.WebControls.CheckBox)
If checkbox.Checked Then
Response.Write("You checked #" & checkbox.ID)
End If
End If
Next


Hope that helps.



Charlie Nilsson [msft]
Visual Studio Update

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Formatted Listbox? 1
Listbox 1
ListBox array in UpdateCommand 1
Checkbox functionality 3
URGENT: Checkbox field in GridView ??? 1
Jquery click checkbox 0
ListItems as checkbox in a listbox 1
Listbox Controls 0

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top