473,465 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to step through the controls in a webform controls collection

Can anyone give me an example in vb.net of how to step through all of the
controls in the current webform controls collection to test the Name value
of each control to look for controls that start with a specific name value
using a "for each/next" construct?

Thanks in advance

David
Nov 20 '05 #1
1 1011
Dim objControl As System.Windows.Forms.Control

For Each objControl In Me.Controls
If objControl.Name.StartsWith("Button") Then
MessageBox.Show(objControl.Name)
End If
Next

"Dave Adler" <dc*****@adlercomputing.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Can anyone give me an example in vb.net of how to step through all of the
controls in the current webform controls collection to test the Name value
of each control to look for controls that start with a specific name value
using a "for each/next" construct?

Thanks in advance

David

Nov 20 '05 #2

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

Similar topics

2
by: Paperback Writer | last post by:
Hi everybody! I tryed to use the Controls.Count in my WebForm to get the number of controls, but it's always showing 3 Controls! In the UserControls it works perfectly!!! Is tha a bug or do I...
2
by: Dave Adler | last post by:
Can anyone give me an example in vb.net of how to step through all of the controls in the current webform controls collection to test the Name value of each control to look for controls that start...
2
by: TM | last post by:
What is the method used to find all asp.net server controls (run at server) such as TextBox, ListBox, CheckBox... currently defined on an Asp.Net page at run time. I need it inside of a controlled...
6
by: TomislaW | last post by:
How to find all user controls (ascx) loaded on a Page?
4
by: Ali | last post by:
I used to clear my page's control in Visual Studio 2003 using code like this: Dim c As Control For Each c In Page.Controls(1).Controls If TypeOf c Is TextBox Then CType(c, TextBox).Text = Nothing...
2
by: Calvin KD | last post by:
Hi everyone, I'd like to interrogate a web form to check for values of the controls on the form. The following codes worked when I execute it in a User Control that has some web controls on it but...
7
by: Rodusa | last post by:
I am trying to loop all controls in a form with no success. For example, Let's say we place three TextBoxes in the form and we use the code below: foreach (Control c in Page.Controls) {...
4
by: WB | last post by:
Hi, How can I generate web controls such as textboxes and drop-menus on the fly? My web application allows users to fill out PDF forms online. There are many PDF forms, and my application...
4
by: John Dalberg | last post by:
I am looking at a problem which is preventing my code to get a reference to any asp control inside a div section which has a runat=server attribute. This can be reproduced in a simple test:...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.