473,395 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Controls on ASPX page

I have a page where I dynamically create checkboxes. When the time comes I
need to know if any of them checked and if they are check I need to update
DB to reflect the changes on the page.
I know the ID's of checkboxes than are on the page but I can not capture
them in any way. I tried looping thought the Controls collection with
different way to capture the checkbox control but no success. Please
help!!!!!!!!
Nov 17 '05 #1
2 883
hi there,

if you are using a checkboxlist control, you can use some code like this:

Dim cItem As ListItem

For Each cItem In checkboxList.Items

If cItem.Selected = True Then

.....perform your action here.

End If

Next

cItem = Nothing

regards,
Paul.

"Ruslan Shlain" <rs*****@hotmail.com> wrote in message
news:#O**************@tk2msftngp13.phx.gbl...
I have a page where I dynamically create checkboxes. When the time comes I
need to know if any of them checked and if they are check I need to update
DB to reflect the changes on the page.
I know the ID's of checkboxes than are on the page but I can not capture
them in any way. I tried looping thought the Controls collection with
different way to capture the checkbox control but no success. Please
help!!!!!!!!

Nov 17 '05 #2
If you are dynamically creating the checkboxes then you
have to create them again during postback.

Their state will be saved in the viewstate.

HTH,
Suresh.
-----Original Message-----
I have a page where I dynamically create checkboxes. When the time comes Ineed to know if any of them checked and if they are check I need to updateDB to reflect the changes on the page.
I know the ID's of checkboxes than are on the page but I can not capturethem in any way. I tried looping thought the Controls collection withdifferent way to capture the checkbox control but no success. Pleasehelp!!!!!!!!
.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web...
10
by: Sacha Korell | last post by:
I'm trying to load a drop-down list with all DropDownList control names from another page. How would I be able to find those DropDownList controls? The FindControl method will only find a...
3
by: Nathan Sokalski | last post by:
When I view any page in my application a second time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize) +313...
9
by: antonyliu2002 | last post by:
I want to create session objects for all web controls in a page. Right now, I am doing it in a dumb way like this (for example): Session("Session1") = ctrl1.Text Session("Session2") =...
1
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
2
by: Scott | last post by:
I'm using a master page (mp_TableMaint.aspx) with one Content area (ID: Content1). Content1 contains several usercontrols, which are hidden. The goal is to show the correct control based on the...
4
by: tshad | last post by:
Is there a way for a User Control to access an object (such as label or textbox) on the .aspx page that calls it? For example: x.aspx ************************************** .... Sub...
4
by: rn5a | last post by:
Assume that a ASPX page uses a user control named Address.ascx which has 2 TextBoxes. This ASCX page creates 2 properties named 'Address' & 'City' using the Get & Set statements: <script...
0
JimWu
by: JimWu | last post by:
I have some problems in my code. The stutiation illustrate as the followsing statement. I use two pages, one, named "upload.aspx", is including several general html input tag, whose type are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.