Under what conditions will the ctl00 prefix look like something else ex. CTL01?

I have inherited an application containing a ton of javascript with hard-coded client identifiers.

In the past, when I downloaded testing, I seem to remember that sometimes the generated client identifier started with ctl01.

Under what circumstances will this happen?

+7
source share
2 answers

First of all, "ctlxx" is the prefix of the main control page.

enter image description here

The ASP.NET engine sets runtime ID values ​​for those controls whose identifiers are not explicitly set. It uses the ctlXX naming pattern, where XX is a sequentially increasing integer value. Thus, in the case of nested main pages, you get a prefix like ctlxx , where xx will increase.

The Id control has a prefix for the value of the main page identifier, ctl00 . The net effect is the id attribute value, which consists of the ID values of the master page , the ContentPlaceHolder control, and the control itself.

Conclusion -

Thus, only if the ctlxx prefix is ​​changed does it have sub-master pages for the .aspx page.

For more information, see Identifying a Control ID on Content Pages (C #) .

+9
source

I think this is an identifier created for each nested main page, you may need to check the theory by nesting, and then see what the identifiers look like, since I don’t have the tools available, where am I now to provide proof: /

+1
source

All Articles