Exposing a server control from a master page as a public property (VB)
<%@ Page Language="VB" MasterPageFile="~/Default.master" %>
<%@ MasterType VirtualPath="~/Default.master" %>
<script runat="server" language="vb">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Master.MasterPageLabel1.Font.Size = 25
End Sub
</script>
File: Default.master
<%@ Master Language="VB" %>
<script runat="server" language="vb">
Public Property MasterPageLabel1() As Label
Get
Return Label1
End Get
Set(ByVal Value As Label)
Label1 = Value
End Set
End Property
</script>
<asp:Label ID="Label1" Runat="server" />