Access Properties from Masterpage

T

Tony

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-us/dnvs05/html/masterpages.asp?frame=false#masterpages_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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top