Re: How can I access a Master Page Public Property from a Base Page
- From: bruce barker <nospam@xxxxxxxxxx>
- Date: Fri, 09 Nov 2007 08:19:27 -0800
even better than a cast, tell asp.net to do it.
<%@ MasterType TypeName="MyMaster" %>
-- bruce (sqlwork.com)
Jay Pondy wrote:
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" %>
On the Master Page I have a public property exposed:
Public Property ErrorMessage() As String
Get
Return txtError.InnerText
End Get
Set(ByVal value As String)
txtError.InnerText = value
rowError.Visible = True
End Set
End Property
From the Content Page I can access the property:
Me.Master.ErrorMessage = "Some Error Message."
If I try and access the Master Page Property from an inherited Base Page with:
Me.Master.ErrorMessage = "Some Error Message."
the IDE highlights the error with:
ErrorMessage is not a member of System.Web.UI.MasterPage
Is there some way I can cast the Base Page Master property to the strongly typed Master Page and access the ErrorMessage property?
- Prev by Date: Loop in SQL Part II
- Next by Date: Re: Export aspx/vb .net to multi-tabbed Excel?
- Previous by thread: Re: How can I access a Master Page Public Property from a Base Pag
- Next by thread: Passing info between pages.
- Index(es):
Relevant Pages
|