Basic question - is it possible to access the current Page
from a static class in ASP.NET?
I am thinking no, as google turns up no results.
See Question&Answers more detail:osBasic question - is it possible to access the current Page
from a static class in ASP.NET?
I am thinking no, as google turns up no results.
See Question&Answers more detail:osTechnically 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
}