In an asp.net webpage I have about 35 textboxes below a gridview, which get populated as you click each of the rows in the gridview.

All works fine, however I would like to clear all fields quickly before populating again.

The fields id are all like these:

txtO1_C

txtO2_C

txtO3_C

txtO4_C

etc...

So I would like to know if there is a possibility in vb to do something like in VBA:

for l=1 to 20
    frmName.Controls("txtO" & l & "_C").Caption = vbnullstring
next l

I am trying to avoid having to do a txtOX_C.Text ="" for each individual textbox if there is faster way...

Related posts

Recent Viewed