D
dkode
Hello,
I know this can be done, but it's beyond me at the moment,
Here is my inheritance chain:
class NavRole : UserControl {
protected void AddSubmenu(string submenuFile);
}
class artist : NavRole {}
class admin : NavRole {}
Now, in the artist and admin classes, there is a placeholder called
plSubMenu, also within these two classes are LinkButtons, if the user
clicks the LinkButton, it saves a session variable (Session["submenu"]
= "artst" or Session["submenu"] = "admin" and then calls
this.AddSubmenu which loads the appropriate submenuFile and addds it to
the placeholder on that page.
After they click a link on the "Submenu" it posts back, and the base
constructor checks to see if the Session["submenu"] is not null, if it
is not then it re-adds the submenu, but from the baseclass I cannot
access the placeholder on the artist.ascx and admin.ascx to add the
submenu control from. The first time around, when the linkbutton is
clicked, i set a property on the NavRole class that is a reference to
the derived classes placeholder. But after postback, it enters the base
class constructor first, before I have a chance to set the reference to
the appropriate placeholder
How can I make it so the Base Class can access the placeholder on all
the subsequent pages to add the submenu control to it.
Any help would be appreciated. Thanks!
Sean
I know this can be done, but it's beyond me at the moment,
Here is my inheritance chain:
class NavRole : UserControl {
protected void AddSubmenu(string submenuFile);
}
class artist : NavRole {}
class admin : NavRole {}
Now, in the artist and admin classes, there is a placeholder called
plSubMenu, also within these two classes are LinkButtons, if the user
clicks the LinkButton, it saves a session variable (Session["submenu"]
= "artst" or Session["submenu"] = "admin" and then calls
this.AddSubmenu which loads the appropriate submenuFile and addds it to
the placeholder on that page.
After they click a link on the "Submenu" it posts back, and the base
constructor checks to see if the Session["submenu"] is not null, if it
is not then it re-adds the submenu, but from the baseclass I cannot
access the placeholder on the artist.ascx and admin.ascx to add the
submenu control from. The first time around, when the linkbutton is
clicked, i set a property on the NavRole class that is a reference to
the derived classes placeholder. But after postback, it enters the base
class constructor first, before I have a chance to set the reference to
the appropriate placeholder
How can I make it so the Base Class can access the placeholder on all
the subsequent pages to add the submenu control to it.
Any help would be appreciated. Thanks!
Sean