I am making a simple website with Visual Web Developer 2005 (ASP.NET), using VB (for the first time).
I would like to loop through all of the text boxes on my simple webpage and concatenate the text value of each textbox into one string.
I can concatenate manually, e.g.
Expand|Select|Wrap|Line Numbers
- Dim s As String
- s = ""
- s = s & txb_001.text
- s = s & txb_002.text
- MsgBox(s)
I've managed to loop throught the controls on the web page, e.g.
Expand|Select|Wrap|Line Numbers
- Dim s As String
- Dim c As Control
- s = ""
- For Each c In Page.Form.Controls
- s = s & c.ID
- Next
- MsgBox(s)
The problem is that there does not seem to be a text property for a generic control object, e.g. there is no
Expand|Select|Wrap|Line Numbers
- c.text
Ultimately I'd like to be able to loop through other controls such as drop down lists and list boxes.
This is so easy for me to do when I work with VBA for Excel, and yet I feel so helpless. Does anyone have some advice?