How is this class library used? From an ASPX page or a class that is used as
an HTTPHandler or HTTPModule? Or, is it out by itself?
The reason I ask, is it is often easiest to pass in the page, by ref, rather
than set up an intricate setup to figure it out from a class called from the
page or HTTP_____. The reason is the wiring is already in place for both Page
and HTTP_____ classes.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Mahesh Nimbalkar" wrote:
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.
--
Thanks,
Mahesh