Wednesday, 15 January 2014

count of the number of controls used on an ASP.Net page -



count of the number of controls used on an ASP.Net page -

is there way count of number of controls used on asp.net page without creating instance of page class ?

asp.net server side controls comes existance after create instance of page. unless create instance of page class there no existance of controls , hence there no question of counting them.

from description, assume want know how many controls might created particular markup (i.e. xxx.aspx page html). suggest couple of ideas that, have not used them myself might work you.

the aspx page contains xml can open xml document , count tags has runat="server" set. give counts of node contains attribute server side controls

read content of aspx file , count instance of particular string "runat=server" give same results in easier way

open aspx page using html agility pack , same thing did in 1 , 2 above.

essentially, inspecting markup can result in server side command when instance of page created.

remember here controls dynamically created code behind not counted, created using designer counted.

asp.net

No comments:

Post a Comment