Value of the control at Master page is not being set from the content page

I am trying to set the value of the control at Master Page from the child page(content page) but the value of the control at master page is not changing..


"Hope its your Solution so Mark it as Answer"

Ahmad Sheikh
Microsoft Valuable Geek
http://sharpcontents.blogspot.com
0
Ahmish
4/5/2007 8:29:14 PM
asp.net.navigation-controls 13714 articles. 0 followers. Follow

1 Replies
759 Views

Similar Articles

[PageSpeed] 33

Here is a good tutorial on doing this from scott.

http://www.odetocode.com/Articles/450.aspx

here is the part you are looking for I think.

Protected Sub Page_Load(ByVal sender As Object, _
                        
ByVal e As EventArgs)

  
Dim footer As Label = Master.FindControl("FooterLabel")
  
If Not footer Is Nothing Then
    footer.Text = "Custom footer text!!"
  End If
  
End Sub

 

HTH's.

 


Peter Kellner
http://73rdstreet.com and blogging at
http://PeterKellner.net
MVP, ASP.NET
0
pkellner
4/5/2007 9:07:47 PM
Reply:

Similar Artilces:

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...

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...

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...

How to acess the master page control value in content page
i want to acess the control which is the part of master page. i want that contol`s  value on the content page.   Friend, try to implement the logic mentioned here http://forums.asp.net/t/1272824.aspx and this one http://wiki.lessthandot.com/index.php/ASP.NET:_Access_Master_Page_controls_from_the_Content_Page Good luck!Please Don't forget to click "Mark as Answer" on the post that helped you.This can be beneficial to other community members reading the thread. Hi, You can try to refer this article:  Passing Information Between Content and Master Pages&...

Problem to use TreeView Control in a 'content page' This Error Occur "Only Content controls are allowed directly in a content page that contains Content controls."
hi I am trying to use the TreeView Control inside the content page (Page that has a master page is a content page). On compiling the project I got the following ASP.Net runtime error: "Only Content controls are allowed directly in a content page that contains Content controls."B@b@R J Issue resolved. I was putting script tag in the content page that is not allowed. when remove the script from content page problem is resolved.B@b@R J...

Access value of a user control from Master Page in content page
 Dear Experts,Please help me on this issue. I have a master page which is composed of user controls like header, footer, left menu and content place holder. Now I want to access a value from header in the content place holder page. How to achieve this? Regards salah You first need to expose the value from the header as a public property and then you'll need to expose that (or the user control) as a public property of the master page. Here's an article about exposing properties on a master page - http://www.codeproject.com/KB/aspnet/InsideMasterPages.aspx; you use the...

Passing Values from a databound control in a Master page to a content page.
Need help with a dropdown menu in the Master page passing values to a Content page. Basically I have a dropdown menu on my master that I want to select and update the content in my Gridview on the subsequent page? I feel silly for asking I know this should be easy.   Bill I wrote an article to do exactly that.  Take a look:http://www.dotnetadvisor.com/Blog/MasterPageControls.aspx Rob Millswww.dotnetadvisor.com In the menu on the master page (or in a web.sitemap file), you can specify urls with querystrings attached (eg ~/Page.aspx?id=1). When you navigate to th...

Master Page
I am using a master page for a website (Vs 2008) . I am facing two problems - 1. In the Login page, I am hiding the logout hyperlink. After the user logs in successfully , I'm setting the visibility of the logout hyperlink to true. But then, when I navigate to another page, the logout button disappears -  forcing me to redo setting the visibility in every page. 2. I have a similar problem with an Image in the page too. When I change the image in the content page after login, it reverts back to the existing image in the master page ( this I guess is because the master page loads...

Passing values from content page to user control on master page
I have a content page that pulls the info for a product. Surrounding this is a master page that has some user controls on it that show content that is specific to the data being pulled in the content page. I already have the content page setting properties on the master page in the code behind, and then the master pages code behind feeding the user controls - all seems to work but seems a tad inefficient in some cases - fine when I need to go back to the databse to fetch more related records, but this particular issue shouldn't need to do that.  My content page initiates a Product cla...

Show content in both Master Page ContentPlaceholder AND Content Page Content control
I note that by default or rendering rules, when you add content/controls to the Content Page ASP:Content control matched to a Master Page ContentPlaceholder, any content/controls in the matching Master Page ContentPlaceholder is not displayed. Is there a setting that can be made to merge or show both content/controls in the Master Page ContentPlaceholder and content/controls in the matching Content Page Content control? Thanks         Don't think so. If you specify a content control in your page then whatever is in there displays and anything in the...

Need to access a Label Control on the Master Page from a user control attached to a content page
Hello all, I have a master page (say  site.master)  with a status Label in it. I have a content page ( say content.aspx)  that has a user control (say usercontrol.ascx). One of the Button Click Events in the usercontrol.ascx needs to pass on some text onto the status label on the masterpage(LabelStatusMsg) and display it. I have been able to do this directly off a content page (content.aspx) by using the following code (VB)  on the master page <%@ MasterType virtualpath="~/site.master" %> and Dim mpLabel As Label = CType(Master.FindControl("LabelStatusMsg"),...

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...

Control of the page and the controls on a page
I am building a web app that has some pages that are public and some that are only available based on subscription. Could someone explain the best way (infrastructure wise) how to control whether a server control is visible or enabledand how to control whether a page is viewable or not based on the user and whether or not the user is logged in (or not). If a user is not logged in I would like some controls to be visible but disabled. I also have to control the URL's in case a person learnsthe URL and tries to type it in. My question is more towards how to do this database wise. I am u...

Access a DropDownList Selected value in a user control from a content page(nested master page)
 Hi All,I have a DropDownList box in a user control called DDLs.ascx. i have a content page called Sample.aspx which is based on a nested master page. the master pages are called parentMP.master and childMP.master. now i am calling the user control(DDLs.ascx) in the childMP.master like below<%@ Register TagPrefix="ddls" TagName="dropdownboxes" src="~/test/DDLs.ascx" %> now as i said there are 2 Dropdownlist boxes ( ddl1 and ddl2) in this user control.what i want is to access the selected value of these dropdownboxes in the content page and pass them t...

Web resources about - Value of the control at Master page is not being set from the content page - asp.net.navigation-controls

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

TERROR IN JAKARTA: 'Situation under control' after explosions, gunfire erupt in Indonesian capital
At least six people are dead, including three police officers, after several explosions at the Sarinah shopping mall in an apparent multi-site ...

DFES downgrades bushfire in Dunsborough as it is contained, but not under control
A BUSHFIRE south of Dunsborough has been contained but is not yet under control.

WA fires: threatening Jindalee blaze brought under control
A fire that was at one stage a threat to lives on homes in Jindalee on Thursday has been brought under control.

Queensland police shut down out-of-control party in Berserker, Rockhampton
Police shut down a party of 150 young people who had gathered at a house in Berserker, Rockhampton on Friday night.

BMW recalls i8 for stability control problem
... , BMW , Safety , Coupe , Hybrid , Performance BMW will recall a small number of 2015 i8s because of a problem with the dynamic stability control ...

ESI cost control and networks
There is an interesting discussion thread on Twitter about how the way Medicare for All saves money is by significantly reducing provider, device, ...

While No One Was Watching, Obama Took Control of the Courts
... and President Obama’s legacy.” It didn’t favor conservatives but there was a dramatic shift to the far left. The appellate is under the control ...

Apple has landed a very rare sponsorship deal to ensure it has control of the hottest ticket in San Francisco ...
Apple has signed up for the first time to become a sponsor of the Super Bowl Host Committee, Daniel Roberts at Yahoo Finance reported. It's ...

Leonardo DiCaprio: The Oscar stuff is ‘completely beyond my control at this point’
... last night’s London premiere of The Revenant . Leo is looking pretty good these days. He’s de-bloated, his facial hair is very much under control, ...

Resources last updated: 1/17/2016 5:07:55 AM