Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search


Web Forms :: How To Change Label Text On Master Page From The Content Page

Can I access the objects (for example change the label text) on the master page, from its contents page code?

If yes, how can I approach that?

View 8 Replies (Posted: Jun 19, 2006 07:07 PM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
Web Forms :: How To Change Label Text In Master Page
iwant to changelabel text in Master page ?

how ?

Posted: Dec 31, 2009 04:37 PM

View 8 Replies!   View Related
Web Forms :: How To Change Content Of Master Page From Child Page
i got a textbox located in master page. How can i update it from child page?

Posted: Dec 18, 2010 02:18 PM

View 7 Replies!   View Related
How To Get A Label Value From Web User Control To A Content Page Using Master Page
I have a web user control book.ascx and a formview:

<formview runat="server" id="fv">
<asp:Label runat="server" id="bookID" Text='<%# Eval ("bookId") %>' />

This formview is databind dynamically.

Now i have a Content page Default.aspx:

<%@ Register src="Book.ascx" tagname="Book" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<uc1:Book id="book1" runat="server"/>
<asp:Label runat="server" id="lblBookId" />

I want to get the value of the label from web user control to a default.aspx page.

Posted: Oct 1 10 at 17:32

View 3 Replies!   View Related
Web Forms :: How To Label Text From Source.aspx Master Page To Target.aspx Master Page
need a label text from source.aspx master page to target.aspx master page using crosspage posting..Bellow is my code... its showing "object reference not set to an instance of an object. "

source.aspx(Master page)
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

Posted: Nov 25, 2008 09:38 AM

View 3 Replies!   View Related
Change Master Page A Href Link From Content Page?
i have this on my

<ul class="menu">
<li class="first" runat="server" id="Li2">
<a runat="server" id="A1" href="../NewEntry.aspx">Create a New Entry</a>
when i go to content page ("NewEntry.aspx") i want the link name to be changed to "Update Entry"
<ul class="menu">
<li class="first" runat="server" id="Li2">
<a runat="server" id="A1" href="../UpdateEntry.aspx">Update Entry</a>

Posted: Sep 9 10 at 13:52

View 4 Replies!   View Related
How To Change Elements In Master Page From Content Page In
i have a page called a1.aspx, with the Masterpagefile = a1_master.master. Now the master page has its own divs and images for design purposes. I want a way where when i load a1.aspx, certain chosen 's and images should be hidden(visible=false). how can i do this? how can i change the visibility of a div or an image in the master page from the content page?

Posted: Apr 13 10 at 20:03

View 2 Replies!   View Related
C# - Get Content Page To Change Master Page Control?
Master page:

<form runat="server">
<Scirra:MainMenu runat="server" ID="MainMenu" TopTabSelected="home" SubTabSelected="link2" />
<asp:ContentPlaceHolder id="MainContent" runat="server">

Content page:

Master.MainMenu.TopTabSelected = "forum";

I know I'm probably doing this wrong, but is this possible? I want to change a parameter of that control. It says 'inaccessible due to protection level'.

Posted: Mar 5 at 23:26

View 1 Replies!   View Related
How To Change Content Page To Another Master Page
I am using ASP.NET 2.0 and C#.

I have a master page and 5 content pages. Icreated another masterpage and want2 of the content pages,which were under master1.master to master2.master.

For example, if the content page is called myhome.aspx, previously i had:


But the content page is still refering the Master1.master only..

How to change the content page to another master page.

Posted: Jan 22, 2010 01:37 PM

View 6 Replies!   View Related
Web Forms :: Hiding Repeater On Master Page From Content Page / Access From Content Page?
My project has the following repeater menu shown on the Master Page. I need this menu to remain hidden until the user logs in. How do I access from content page?


Posted: Oct 06, 2010 09:16 PM

View 2 Replies!   View Related
Forms Data Controls :: Search Text Box In Master Page And The Editable DataGrid In The Content?
I don't know how to keep in sync the filtered elements of a DataGrid after the user applies a filter. The problem is when she/he tries to edit one filtered elements.... it is not the correct item!


How to update the index for the elements returned by the filter process?

Posted: Jan 19, 2011 01:35 PM

View 2 Replies!   View Related
Web Forms :: Content Controls Are Allowed Only In Content Page That References A Master Page.
which page need to be checked. Master or Content. I dont think there is anything wrong in the content page.

Posted: Jun 25, 2010 05:45 AM

View 1 Replies!   View Related
C# - Want To Find Master Page's Content Placeholder And Add Text To It?
I tried this much:-

protected void Page_PreInit(object sender, EventArgs e)
class1 obj = new class1();
DataTable dt = new DataTable();
dt = obj.get_text();
ContentPlaceHolder ContentPlaceHolder1 = ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");
ContentPlaceHolder1. ????

Posted: Dec 21 10 at 12:18

View 3 Replies!   View Related
Web Forms :: Accessing Master Page's Body Tag From Aspx Page That Is Not A Content Page
I am using Master page and Content page combination.But how can i access <body> tag and it's event (onload, onunload) of Master page in .aspx page that is not a content page.

Posted: Jan 08, 2011 11:03 AM

View 12 Replies!   View Related
Web Forms :: To Get A Normal Html Page Inside The Master Page Instead Of Content Page?
I have a master page homeMaster.aspx and many content pages. However the situation is I have few .html pages. Now when a user clicks on a link the html page should get loaded.inside the master page. The problem is these are .html and not content page with .aspx.

Posted: Mar 25, 2010 02:19 PM

View 4 Replies!   View Related
Web Forms :: Master Pages - How To Access Content Page From Master Page
I have a master page setup that is used throughout my site that is basically a header with a menu. I recently added a textbox and a button to this master page which is to be a quick search box that is available anywhere in the site. When a user enters text into the search box and hits the button, I need to load the actual content page which is used to search and show search results (which also uses this same master page), and have the text entered available so the search can be triggered automatically. Again, this search text box and button is now in my master page so it could be triggered from anywhere in the app... it serves as a convenient way to do a basic search from anywhere in my app, without having to first navigate to the actual 'search page' that already exists. You can also navigate to the actual search page, which uses the same master page, where there is many more search options.I'm thrown off by the master page arrangement, which I have not used until this project. What do I do?

Posted: Sep 05, 2010 01:43 AM

View 4 Replies!   View Related
Crystal Reports :: How To Change Text Of A Label In Page Header Using Code
How to change text of a label in page header using code?

I need to change it based on data source of report.

Posted: Feb 02, 2011 02:30 PM

View 3 Replies!   View Related
Forms Data Controls :: Trying To Change A Label's Text Property And Colour Properties Depending If An Event Occurs On The Page Behind File?
I'm trying to change a Label's text property and colour properties depending if an event occurs on the page behind file.

Does anyone have a similar issue?

if (((Label)FindControl("Label1")).Text != null) - //getting Object reference not set to an instance of an object.

Label Labelmerchantid = (Label)FindControl("Label1");
Labelmerchantid.Visible = true;
Labelmerchantid.ForeColor = System.Drawing.Color.Red;

Posted: Jun 04, 2010 03:21 PM

View 4 Replies!   View Related
Web Forms :: Accessing Master Page Content From Content Page?
I am having asp:hyperlinks in my master page, which i use as my pageheaders.I would just like to change thetext format of the hyperlink when a content page is loaded.

the CS code for accessing the master page contents from content page?

Posted: Feb 16, 2010 04:49 AM

View 3 Replies!   View Related
Web Forms :: How To Access HTML Label Value Of Master Page On Any Other Aspx.cs Page
The HTML label control is on master page. And I want to access its value on other aspx.cs page. As there are many other control on the master page so i use the recursive function to access the value but NullReferenceException occurs... The code on aspx.cs page is as:


Posted: Nov 15, 2010 04:44 AM

View 5 Replies!   View Related
Web Forms :: Updating A Master Page Label Per Page On Site?
I have a label within mymaster page that is part of our footer. In the footer, we are wanting to display page specific information. So as you make your way around the site, the footer will contain content about that page along with other data that is universa on the entire site.I had a somewhat similar question some time back that i posted here.. was for a shopping cart of sorts..


If Label is in master page, you have to use FindControl to get the Label and udpate its text

((Label)Master.FindControl("cartct")).Text=String.Format("{0} ItemsInCart",ShoppingCart.Instance.Items.Count() );

once you select another page, you dont have it anymore,If you want to share data across different pages, consider using Session to save Items count.

Posted: Dec 13, 2010 05:28 PM

View 6 Replies!   View Related
How To Run The Javascript Function On The Page Onload Event In Content Page Of Master Page

means i have masterpage and the content page of master page namely default.aspx in

My problem was that .

i wanna run javascript function in Default.aspx and i have called the function

body onload in master page..

when i run my website it shows the error

"" Microsoft JScript Runtime Error : Object Expected ""

Posted: Nov 4 10 at 10:12

View 4 Replies!   View Related
Web Forms :: Changing Nested Master Page Contents Form Content Page
Following is the structure of the pages in application


Suppose the user is on ..../paycheck.aspx which is the content page. But when ...../paycheck.aspx loads, "lnkDynamic" properties "Text and PostBackUrl" must be set. Which events should be handled .....

Posted: Dec 23, 2010 07:12 PM

View 3 Replies!   View Related
Web Forms :: Calling Javascript Method During Page Load From Content While Using Master Page
I want to call a javascript method during page load. I am using application.master of the sharepoint server 2007 as the master page . In the content page i want to call a custom method named OnLoadFun() during loading the content page. I have written the function inside script tag in the PlaceHolderAdditionalPageHead id section of the content page.


How do i call the OnLoadFun method so the i is being called onload time. i tried putting window.onload=OnLoadFun surrounded by script tag within the PlaceHolderMain content section.

Posted: Mar 30, 2010 10:06 AM

View 1 Replies!   View Related
Web Forms :: Expand A Child Node In A Treeview That Is In A Master Page From A Content Page
need to expand one of the nodes in my treeview from a content page. Everything I have tried has not worked. The Treeview is located in a Master Page and built from a web.sitemap. I have a content page that is not listed in the sitemap, but I still need to expand the node.
I have been able to expand by depth by using the following.

Dim MasterTree As TreeView
MasterTree = DirectCast(Master.FindControl("TreeView1"), TreeView)
MasterTree.ExpandDepth = 0

What I need to do is to pick a child node and expand it from the content page. (the administration node)

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns=""

Posted: Aug 18, 2009 08:25 PM

View 5 Replies!   View Related
Web Forms :: How To Call A Javascript Function On A Master Page From A Content Page Control
I have ajavascript function on my Master page, how do I access it with a dropdownlist of a content page. Not from codebehind, I can do that, but from the control itself such as the onSelectedIndexChanged event.

Posted: Jan 24, 2011 01:24 PM

View 11 Replies!   View Related
Web Forms :: How To Remove Master Page Prefix From Control ID After Rendering Content Page
how to remove master page prefix from control ID after rendering content page

i m using master page in my web application, i am using a java script that works on one of my div id and i am genrating div at run time using C# code, problem is that one one of my content page rendred a prefix ct100 attached on that div,

How can i remove that prefix from my server side control (assume panel) id

Posted: Jun 26, 2010 06:22 PM

View 2 Replies!   View Related
Web Forms :: How To Acess Controls Of Master Page In Content Page In 2005 Using Javascript
I am developing a project to in my company i am facing few problems using 2005 they are listed below: to acess a control of one content page in another content page as in 2003 we can acessing by the following script like window.opener.document.getelementbyID(''); but i am not able to acess in content page.

2. Is there any way so that once the Popup Window is closed i need to executed only specified methods in parent page. If i use window.parent.reload it will consider a new page and all the controls are reloaded and all the things enterd will be lost.

3.How to acess Controls of Master page in Content page in 2005 usingjavascript

Posted: May 03, 2007 03:21 PM

View 2 Replies!   View Related
Web Forms :: Master Page Styles Not Inherited When Content Page Is Not In Root Folder?
I have a MasterPage at Rool level.

I have 2 content pages:

RootContent.aspx - at Root folder where MasterPage is, and SubFolderContent.aspx - inside a subfolder.

Now, the css styles like backgroung images etc are displayed properly when I open RootContent.aspx, but when I navigate to SubFolderContent.aspx, these style are not displayed.

Is there any security issue that SubFolderContent.aspx cannot access the Root level master page style.

I have used the following Page Directive in SubFolderContent.aspx:

<%@ Page Title="" Language="VB" MasterPageFile="~/DefaultMaster.master" ...

Posted: Aug 08, 2009 02:58 AM

View 9 Replies!   View Related
Web Forms :: To Access A Public Property In A Master Page From A Nested Content Page
to whom it may concern,

I wish to access a public property in a master page from a nested content page

is there anyway to do that without using "master type"

i found this link

but i dont understand what "companywide" is

((CompanyWide)this.Master.Page.Master).HtmlTitle = "now it is working";

i dont want to use "MasterType" i would rather cast..

Posted: Apr 26, 2010 08:40 AM

View 11 Replies!   View Related
Web Forms :: Content Page Retrieve Info From Master Page Form?
I have a master page with a form on it. It's a people search form. When the user clicks on the search button it goes to the search resultspage that uses the same master page. With the code below I get the info off the master of the current page. Howdo I grab that info from thefirst page?
Here's the code:

Master page:

< FORM id=formEmpSearch method=post action=~/About/peopleSearch.aspx runat="server">
< asp:TextBox style="WIDTH: 153px; HEIGHT: 12px" id=txtSearchName onfocus="this.value=''" runat="server" CssClass="searchBox">

Master Code Behind page:

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Partial Class mstrIntranet
Inherits System.Web.UI.MasterPage
Public Property mSearchName()
Return txtSearchName.tex
End Get
Set(ByVal value)
txtSearchName.text = value
End Set
End Property

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
txtSearchName.Text = "People Search"
End Sub End Class

Search Results Code Behind page:

Partial Class PeopleSearch2
Inherits System.Web.UI.Page
Public SearchName As String

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim mpTextbox As TextBox
mpTextbox = CType(Master.FindControl("txtSearchName"), TextBox)
SearchName = mpTextbox.Text

Posted: Dec 07, 2010 04:51 PM

View 1 Replies!   View Related
Web Forms :: How To Retrieve Value Of Hidden Control In Master Page From Content Page
Is it possible to get the value of a hidden control that is in the master page from the content page? I tried it and i can access the control but it gives a value of empty string. However, on the page load event of the master page, i set the value of this hidden control.

Posted: Oct 20, 2009 09:05 AM

View 2 Replies!   View Related
Web Forms :: Master Page Hidden Field Accessed Through Content Page?
Wondering if it is possible to access a master page's hidden field (ex. <Input Type="Hidden" ID="TestHiddenField" Value="testValue"/>) From a Content Page's C# Pack CS Page.If it is possible, How do I go about doing so? I have tried:

PreviousPage.Master.FindControl("[TestHiddenField]") but no .Value attribute and no luck in general.

Posted: Aug 18, 2010 06:02 PM

View 3 Replies!   View Related
Web Forms :: Master Page Changes Width When Tab Control Is Added To A Content Page?
I have been building a site wiht a few problems but so far I have been able to resolve them all... EXCEPT FOR a new one which has poked it ugly head up... Icreated a new Content Page and added an Ajax Tab control to it and immidiatly the MasterPages width hsa reduced and when Run is not as wide as the content page itself?I am using VS2008 w/ASP.NET 3.5 running on IE8 and Vista.All the other Contrent pagesareworking great.

Posted: Oct 12, 2009 04:06 PM

View 8 Replies!   View Related
Web Forms :: Call Function Declared In Content Page Through Master Page?
I want to access a public function declared in a content page through the master page. What I want to do is , I have a master page and a few content pages that have the same master page. On click ofa buttonin the master page I want to call a function fom the content page.All my content pages have the function with the same name...but they have different functionality based on the page. Does anybody know how to do that?

Posted: Jun 11, 2007 01:27 AM

View 4 Replies!   View Related
Web Forms :: How To Use StaticSelectedStyle In Menu Control With Master Page/Content Page
I have a MasterPage where I use the menu control. Clicking a menu item loads a new content page. That part works fine.

I would like to use staticselected style to change the look of the selected menu item. However, when the new content page loads, the staticselectedsyle formatting does not work.

Posted: Jan 14, 2010 06:41 PM

View 6 Replies!   View Related
Web Forms :: Access User Control Of Master Page In The Content Page
I have a user control in the master of my website and I want change some property of that control from the content page.

Posted: Jan 27, 2010 10:22 AM

View 3 Replies!   View Related
Web Forms :: Accessing Master Page From Content Page - Raising Event?
Here is my situation: I have a user control that has a menu in it. This user control sits on my master page. It is my main navigation menu for my application. I am having an issue where, on one of my pages, users seem to be leaving the page before committing all changes to the database, which results in a loss of data. So what I want to accomplish is - if the user is leaving this page and the data has not been saved yet, I want to prompt the user and say something like "The information is not yet saved, are you sure you want to leave this page" in a modal popup. So my approach is this: In my menu user control, create an event handler called MenuClicked that is raised when the menu web control's (in the user control) MenuItemClicked is raised, I raise my custom MenuClicked event. Then on my master page, I can catch this event in NavMenu_MenuClicked. My problem is - I need to catch this event in my content page, not the master? Am I approaching this correctly?

Posted: Sep 10, 2010 02:55 AM

View 2 Replies!   View Related
Web Forms :: Prevent Master Page From Loading Whenever Content Page Loads?
The problem with my web application is when ever i load the home page - The master page as well as content page loads ---This seems fine but when i navigate thorugh the website which have the same Master page but diffrent content page .... the master page loads again. What i want to do is ..I want to keep the master page intact and only the content page loads. How can I accomplish it..

Posted: Mar 10, 2010 03:08 AM

View 3 Replies!   View Related
Web Forms :: Unable To Access Master Page Control From Content Page
i have big problem with accesing master page component from content page. In master page i have one label and content placeholder.

Master page (masterpage.master) is as:

<%@ Master Language="VB" AutoEventWireup="true" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<html xmlns="" >
<head runat="server">
<form id="form1" runat="server">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

From content page Im trying to set value to label on master page.
Content page (default.aspx) is as:

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" title="" %>
some text inside
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

From default.aspx.vb Im trying the text property of label on master page as:

Dim lab As label
lab = Master.FindControl("Label1")
lab.Text = "some new text"

When Im debuging it, so in lab I have the real value from master page label, When I assign the "some new text" to property .text, it seems from watches that its set. But problem is that in thefact the label has old text and isnt changed. I tried with try catch find some error too, but with no succes.

Posted: Nov 11, 2009 03:38 PM

View 2 Replies!   View Related
Copyright 2005-08, All rights reserved