G
Guest
In my class library I need to access my current Webform (class). As I am
using HttpHandler for ASPX page, following lines of code are throwing error
that {"Specified cast is not valid." }.
// BasePage is custom class derived from Page
BasePage page = (BasePage) System.Web.HttpContext.Current.Handler;
Here System.Web.HttpContext.Current.Handler is returning handler and that is
why not able to cast to page.
How do I get a reference to current executing page in class library?
Any help would greatly be appreciated.
using HttpHandler for ASPX page, following lines of code are throwing error
that {"Specified cast is not valid." }.
// BasePage is custom class derived from Page
BasePage page = (BasePage) System.Web.HttpContext.Current.Handler;
Here System.Web.HttpContext.Current.Handler is returning handler and that is
why not able to cast to page.
How do I get a reference to current executing page in class library?
Any help would greatly be appreciated.