Basic question - is it possible to access the current Page from a static class in ASP.NET?
Page
I am thinking no, as google turns up no results.
Technically you could just get the current IHttpHandler for the request. Since Page implements that, then you could check to see if it is one.
var page = HttpContext.Current.CurrentHandler as Page; if(page != null){ // Do something with page }
2.1m questions
2.1m answers
60 comments
57.0k users