J
Jenda Krynicky
Sorry I'm probably missing something basic, but can't find it in the docs.
Is it possible to access the public properties of the page containing the
UserControl from within the control? Without having to set the link up from
within the code of the page of course.
Most of my pages inherit not from System.Web.UI.Page, but from my own class.
The class has a Public property, an object containing info about the
currently logged in user. Some of the pages use a UserControl I made. The
control also needs access to the object (or needs to create its own based on
the info in Context.User.Identity).
I know I could add a public property "login" to the control and set it to
the created object from within the initialization code of the pages, I know
I could do it by just inheriting another template page from the one I
already have and inherit the pages that use this UserControl from the new
template, but I'd rather not. I think the control must have a reference to
its container already.
Thanks, Jenda
Is it possible to access the public properties of the page containing the
UserControl from within the control? Without having to set the link up from
within the code of the page of course.
Most of my pages inherit not from System.Web.UI.Page, but from my own class.
The class has a Public property, an object containing info about the
currently logged in user. Some of the pages use a UserControl I made. The
control also needs access to the object (or needs to create its own based on
the info in Context.User.Identity).
I know I could add a public property "login" to the control and set it to
the created object from within the initialization code of the pages, I know
I could do it by just inheriting another template page from the one I
already have and inherit the pages that use this UserControl from the new
template, but I'd rather not. I think the control must have a reference to
its container already.
Thanks, Jenda