ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

How can you loop through all controls on an ASP.NET Web form?

user-image
تم إضافة السؤال من قبل Zaid Rabab'a , Software Development Team Leader , Al-Safa Co. Ltd.
تاريخ النشر: 2013/01/08
marwa khalaf
من قبل marwa khalaf , .Net Developer , Sands National Academy

You can easily traverse all controls on a form via the Web Form’s Controls collection.
The GetType method can be used on each control to determine its type and how to work with it.
Now, it gets tricky because the form contains a tree of controls; that is, some controls are contained within others (think of a Table).
You would have to recursively loop through the controls to make sure everything is processed.

Omar Alsoudani
من قبل Omar Alsoudani , Software Engineer , Codeobia , Amman

Web Form’s Controls collection

Furqan Ul Karim
من قبل Furqan Ul Karim , Senior Delivery Manager (Contract) , Virgin Red

using for each loop with the page controls collection .
Easy isn't it.

المزيد من الأسئلة المماثلة