473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Inherited control, accessing base class PlaceHolder

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 26 '06 #1
0 1779

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: patrick_a | last post by:
Hello, I am trying to insert multiple instances of a custom user control into a placeholder on an aspx page, based on the records retrieved from the database. I use the datareader to loop through...
5
by: Jonah Olsson | last post by:
Hello guys, I have an application which is built upon several user controls. That is, I have a default template (default.aspx) that I load a user control into (using placeholders in the...
2
by: paul meaney | last post by:
All, myself and another developer have been staring blankly at a screen for the past 48 hours and are wondering just what stunningly obvious thing we are missing. We are trying to load up 2...
0
by: John Crowley | last post by:
I'm having an odd problem with viewstate and a dynamically created control inside a repeater template. Basically, I have a repeater setup like this in the aspx:
0
by: Brandon Potter | last post by:
I am building a large template-based ASP.NET app using inheritance and loading user controls as the method of loading templates and populating them. I catch the requests for pages in Global.asax...
2
by: Vivek Sharma | last post by:
Hi There, I have a situation where I wish to load the controls dynamically on the basis of user role. Hence, I am using this code. if (UserRole == "IS Administrator") { Control UC1 =...
3
by: Wayne Brantley | last post by:
VS2005 RTM Create a web user control to use as a base class for other web user controls. Now, create a new web user control, change the class it inherits from to your base class and compile....
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
4
by: Alan T | last post by:
I got a method in my ancestor form declared as Protected, this method has empty body. In my descendant form I declared as Protected also, then compile has no problem but the name of the method has...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.