CS0012 when referencing controls on master page's master page.

 I'm working with a content page that has a master page (we'll call it ChildMaster). ChildMaster also has a master page (ParentMaster). There is a control on ParentMaster I need to access from the content page. The code looks like this:

  

ControlType controlInstance = (ControlType) Master.Master.FindControl("controlID");
 
When I upload, I get CS0012 telling me that ParentMaster is defined in an assembly that is not referenced, and I need to add a reference to some assembly with a funky random-looking name (which changes when I reupload ParentMaster). Up til now, I have been able to circumvent this error by reuploading either the content page and its code-behind or ParentMaster. However, I can't get around it anymore. ParentMaster inherits like: Inherits="ParentMaster, SomeAssembly" where SomeAssembly is where the ParentMaster class is declared. It seems like I need to give the content page a reference to SomeAssembly, but I'm just not sure how.
0
SippyCup
4/23/2009 3:46:41 PM
asp.net.navigation-controls 13714 articles. 0 followers. Follow

1 Replies
1069 Views

Similar Articles

[PageSpeed] 57

 Well, the solution was stupidly easy:

  

<%@ Reference VirtualPath="~ParentMaster.master" %>
 
At the top of ContentPage.aspx.
0
SippyCup
4/23/2009 6:51:22 PM
Reply:

Similar Artilces:

How can I access the property a control on a master page from the master page's code behind.
On my master page I have a label. I want to change this label's text property based on an element of the querystring. (label.text = "NewValue")All child pages using this master will display the same thing so I was trying to put the code in the master page so as not to have to duplicate it for the child pages or put it in a base class and use FindControl.Is it possible to access from a master page's codebehind the property of a server control that is placed on a master page's aspx? If so how?(I saw similar questions, but they all came from the view of a child accessing the property.)Thank you...

Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Why in the world am I getting this error? The solutions I have seen either don't apply or don't work.  Here is my master page code:<%@ Master Language="C#" AutoEventWireup="false" CodeFile="TechLMSMasters/MainSide.master.cs" Inherits="MainSide" %> <%@ Register TagPrefix="usercontrol" TagName="Search" Src="~/library/uc/Search.ascx" %> <%@ Register TagPrefix="usercontrol" TagName="UserName" Src="~/library/uc/UserNameDisplay.ascx" %><!DOCTYPE html PUBLI...

How to set a Master Page's control's property through content page on a postback event?
Hi all, i m using a master page in my application. i have a panel on master page and a tab container with three tab panels on content page. i want to set/change  the visibility of the panel control when the tab is changed on the content page. By default the panel is invisible. To implement this i executed the following steps: 1. Set AutoPostBack of tacontainer to true 2. Wrote an event handler for ActiveTabIndexChanged event of the tab container 3 Wrote the following code on Tab changed event   if (TabContainerEmpPerformance.ActiveTabIndex == 1) { ...

ERROR Content controls have to be top-level controls in a content page or a nested master page that references a master page.
This all used to work until about 5 minutes ago. Did I change something? For some reason I am now getting this error: Content controls have to be top-level controls in a content page or a nested master page that references a master page. What I have:  I have a masterpage inside of a directory. That directory is a first level directory with its own web.config file....The whole thing is protected by the web.config file above it (in the main public directory). That main public directory has a masterpage as well. I am not currently linking the two masterpages together becuase...

Error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.
when I make a directory on my root, and in that directory I put a masterpage and a web form ... I get always an error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.   Does somebody know what the problem is ? Is it possible you can't set a masterpage in a directory ... ?Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) i've founded ... I had to nest my masterpage ...Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) Hi Joeri Pansaerts, I am receiving the same error as the one posted her...

Master Control
I find Master Page idea brilliante. But wouldn't it be nice to have an ability to assign master layout for user controls? Does anyone know of something like that? Look into Themes and Skins. Skins are user to set a template for a contol.Themes and SkinsThemes and Skins 2 www.hopeasp.net Hmm Sean, themes and skins will only help with STYLING the components not layout. What I need is something to set the LAYOUT of the user control and use that master layout to place components in. Like in master page but in user controls.Simple example: Master Control fileUsercontrol layout st...

How to access a Master's page control from Default.aspx page
I have a Label control in a MasterPage.master. How can I to modify this Text propierty from Default.aspx. The master page of default.aspx is MasterPage.master. Thanks Hi, you could expose the label's text as a public property on the master page. In the webform use the @MasterType directive and you can strongly typed call the property. Take a look at this page: http://msdn2.microsoft.com/en-us/library/xxwa0ff0.aspx. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons....

How do i get master page's Controls value into Content page!!!
  Hi to All,   I have a Master Page that Contains 4 dropdown lists and 2 Checkboxlists(that contains lot of check box list items) and one Search Button. now i want to search according to master page's controls parameters and display it on content page.now my problem is how do i get the master page's controls(dropdown lists,Checkboxlists)  values into content page. i did use properties for that in master page and calling these properties in  content page like this: Master.master:public string RegionState { get {if (Session["regionState"] == nu...

How could a master page control call a content page's function?
Dear all: For example: 1. In master page, place a button named "button1" . 2. Add three content page, ( add some code )3. Run application, in content page 1, click button1, show "this is page1",  in content page2, click button1, show "this is page2", and so on . Besides, these code should be in every content page instead of in master page, because actually action should be very complex, master can't predict everything. Is this possible?  Thanks!  Here's a great tutorial that may get you started: Creating a Common Toolbar in ASP.NET ...

Accessing a master page's control in a nested content Page(Urgent)
Hi all, I have a masterpage rm_master.masterand another masterpage rm_sub.master which inherits from rm_master.master. Now I want to access a dropdownlist control in a content page which derieves from rm_select_master. the code i used wasDropDownList DropDownList1 = (DropDownList)Master.FindControl("DropDownList1");string a; a = DropDownList1.Text;   The error i got was "Object reference not set to an instance of an object". Please help.. Thanks in advance.. Bharath You can try Page.FindControl or use the mastertype directivePlease remember to click “...

Accessing contnet page's control in the Javascript code of master page
Hello  I have one master page in which i put javascript code, CSS and one Content place Holder. In my content page i add two control one for Login and another for pass word and one Custom validator control. Now i want to call the Javascript code which is written in Master page as the Clinet function in my Custom Validator control to run to validate the value entered in the login and password(TextBox) control. How i do this. My content page having Server side script that i want to call to validate page at the server side. For submitting the page i use Button control and in its PostB...

passing querystring from user control to master page's content page
Hi all,        I have a master page which contains two linkbuttons. I want that when user clicks first link button then querystring value is passed to content page's Initialize culture method. how can i do this. English | Spanish < - user control link Master page contains this user control Default page's initializeCulture method need to know which link is clicked and then set culture according.  code inside initializeculute is like thisif (Request.QueryString["Culture"] == null) {Culture = "en-US"; } else {Culture =...

HELP..... Master Page Error (The page has controls that require a Master Page, but none is specified.)
Hi, I had almost finished creting my master page to use as a template for all future internal applications.  I had created a template to use in creatign new applications and had sucessfully created a new project based upon the MasterPage template... All was working well when I noticed a small graphic inconsistancy on the MasterPage... I reopened the MasterPage and I got teh above error message... I have looked at the HTML and everything seems to be okay and there including the header lines... <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits=&qu...

Doing Postback from master page to page in master's content place holder(search page)
Hi, Currently I am trying to do a postback which returns results. The master page has a textfield and button and the button redirects to the search page.The search page also has a textfield and button and when the button is clicked, the query statements take the input from teh user and looks for results. Currently, A Crosspage postback of master page + other pages in content place holder ------> master page+search page in content place holder works.I am trying to do a postback which returns results in master page+search page which gets its input from the textbox of the master page ...

Web resources about - CS0012 when referencing controls on master page's master page. - asp.net.navigation-controls

Topologically Integrated Geographic Encoding and Referencing - Wikipedia, the free encyclopedia
Topologically Integrated Geographic Encoding and Referencing , or TIGER , or TIGER/Line is a format used by the United States Census Bureau to ...

Facebook Testing Posts From Pages Users Haven’t Liked Referencing Pages Users Have Liked
Some Facebook users are seeing organic posts in their news feeds that suggest posts from pages they have not liked when the posts are in reference ...

McDonald's Ad Referencing 9/11, Boston Bombing Provokes Strong Reactions
NEW YORK — An ad by McDonald's is testing the fine line companies need to walk when referencing national tragedies. The ad by the world's biggest ...

iCloud storage warning emails already referencing iOS 8 & iCloud Drive
Those annoying iCloud storage warning email notifications have begun referencing the upcoming iOS 8 and iCloud Drive, according to multiple tips ...

Begich, Sullivan campaigns pull controversial ads referencing Mountain View case - Alaska Dispatch
... representing the victims' family in a high-profile murder and sexual assault case in Anchorage, the Sullivan and Begich camps pulled ads referencing ...

Protesters briefly disrupt Google I/O, referencing evictions, “robots that kill”
This blurred action shot is what happens when protesters unexpectedly disrupt a Google I/O keynote. The world of big tech conferences is usually ...

Emma Sulkowicz Created Rape-Referencing Video - artnet News
Watch the video that Emma Sulkowicz allegedly created, which alludes to rape, and seems to build on her controversial mattress performance.

A quick guide to referencing
Back in March as part of a series on Blog Ethics I wrote about Attribution where due , but in light of all the recent noise about spam blogs, ...

Man Arrested for Throwing Books While Referencing Scripture in Lakewood Church Store
A man was taken into custody for tossing books and knocking displays down all while referencing a particular scripture in Lakewood Church's book ...

“Tesla Crash” Website — Connecticut Auto Dealers Association Makes Anti-Tesla Website Referencing Content ...
... it simply can’t be helped. Case in point: the Connecticut Auto Dealers Association recently put together a new anti-Tesla website referencing ...

Resources last updated: 1/6/2016 5:34:29 PM