469,927 Members | 1,623 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

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 995

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Steve Franks | last post: by
4 posts views Thread by RedHair | last post: by
3 posts views Thread by Alex Maghen | last post: by
4 posts views Thread by Boris Yeltsin | last post: by
6 posts views Thread by =?Utf-8?B?SmF5IFBvbmR5?= | last post: by
3 posts views Thread by tshad | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.