Casting to specific asp.net page type
- by DEH
I have an asp.net page with a code-behind class definition as follows:
public partial class examplepage : System.Web.UI.Page
I'd like to set a public property within the page that I can reference from other classes. My understanding is that if I cast to examplepage then I should be able to get at the public property that is specific to example page, as in:
string test=((examplepage)HttpContext.Current.Handler).propertyX;
However, when I try casting as above the compiler does not recognise examplepage. Can anyone tell me how I can cast? I have no specific namespaces defined.
Thanks