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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top