By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

Derived UserControl accessing base class PlaceHolder

P: n/a
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

Apr 25 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.