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 }
1.4m articles
1.4m replys
5 comments
57.0k users