473,320 Members | 1,829 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,320 software developers and data experts.

Access Properties from Masterpage

Hi,

I'm trying to access properties from a masterpage. With no success. Can
somebody help me please?

I used the example at:
http://msdn.microsoft.com/library/en...rpages_topic11
(Exposing Properties and Methods from a Master Page)

here my code:

MasterPage.master:

<%@ Master Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Private _footer As String

Public Property Footer() As String
Get
Return _footer
End Get
Set(ByVal value As String)
_footer = value
End Set
End Property
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
<small><%=_footer%></small>
</form>
</body>
</html>
ContentPage.aspx:

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled
Page" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Master.Footer = "Custom Page Footer"
End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="server">
</asp:Content>
Thank you, Tony
Nov 18 '05 #1
0 1081

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

Similar topics

2
by: Steve Franks | last post by:
I am trying to access strongly typed properties in a page's master page from the content page. I followed an article that describes how to do this, and it seems quite straight forward. However...
4
by: RedHair | last post by:
I have a base page class A which inherits System.Web.UI.Page class then a aspx page B inherits class A and have a master page C. There is a property D (a string variable) in the master page C. ...
3
by: Alex Maghen | last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a MasterPage and the code that resides in the code-behind of the actual pages that USE that MasterPage. I'm noticing,...
2
by: Mark Rae | last post by:
Hi, It's easy enough to get a content page to refer to public properties on its associated master page e.g. public partial class master_secure : System.Web.UI.MasterPage { public Label...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
1
by: zb | last post by:
Here is the scenario: I have a page derived from a MasterPage. The MasterPage has a user control that exposes two properties that as public and can be used by other objects. Question: How...
6
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %>...
3
by: tshad | last post by:
In VS 2005, I need to get access to the body tag which I have set up on my Master Page as: <body ID="MyBody" runat="server"> But when do something like: ...
2
by: Poofactory | last post by:
HI, I have a control on a content page that I need to access and modify a MasterPage variable. I can find the control alright: if (Parent.Page.Master.FindControl("Adserver_TopBanner1") !=...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.