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