Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Derived Page class

Apr 12 2003 12:04 AM
I have a standard class that derives from System.Web.UI.Page, and all my ASP.NET pages derive from this. My class includes an exposed property Entity (of type 'RVEntity' which I have also built) : eg public class RVPage : System.Web.UI.Page { private RVEntity _rvEntity=new RVEntity(); public RVEntity Entity { get { return _rvEntity;} } ...... } My pages (code behind): public class MyPage: RVPage { ....... } So on any page I can get a reference to the Entity object. This works OK. My question relates to when I have user controls on the page, I would also like to get access to the Page's Entity object from within the Control. When I use the Page property of the Control it tells me that System.Web.UI.Page does not expose this property. I would have thought I'd have a reference to type RVPage. Any help appreciated, I'm a relative newbie to .NET.

Answers (2)