Web Form Controls in ASP.NET

  • Thread starter Thread starter mr.ali S. via .NET 247
  • Start date Start date
M

mr.ali S. via .NET 247

Hi all,

How to iterate through all of the controls on the Web Form using VB?

When I just use the following line, it always gives me 3!!! but I don't have 3 controls!!!!

Response.Write(" count:" & Controls.Count)
 
You have to differentiate between "controls" and "server controls".
Client-side controls (such as <input type="text">) would not be available to
iterate through via server-side code. Only controls that have
"runat=server" in them would be available to iterate through.
 
Back
Top