I am trying to extend the page class to add some new features (ease of use for some methods, as they will be called directly inside the code of this page) in ASP.NET, and I get a strange error:
My method is called SetQuery,
if I type SetQueryin the page class, it is not recognized (yes, I added using [Namespace];),
if I type base.SetQuery, it is visible in IntelliSense, but it does not compile, saying that the extension method or method was not found on the page
if I type (this as Page).SetQueryIt is recognized and works.
Especially the second case seems to me to be a mistake, since IntelliSense recognizes it as an extension method, but not compilation.
Is there any “more natural” way to enter SetQuery when I go, without a cast, etc.?
source
share