Why do I need it. does the qualifier use the extension method on the main page?

I have the following line of code in some main page code behind, but it fails without this.Why is this?

Repeater rep = this.FindControlsByIdRegEx("maintTableRepeater")[0] as Repeater;

This is on the main page of the Load event, and the extension method is defined as:

        public static List<Control> FindControlsByIdRegEx(this Control control, string idPattern)
+3
source share
1 answer

Extension methods must have an instance to hang.

- . . , , - - , - , .

+3

Source: https://habr.com/ru/post/1717528/


All Articles