Re: How can I access a Master Page Public Property from a Base Page
- From: Alexey Smirnov <alexey.smirnov@xxxxxxxxx>
- Date: Fri, 09 Nov 2007 12:17:35 -0000
On Nov 9, 12:03 pm, Jay Pondy <jpo...@xxxxxxxxxxxxxxxxxxxx> 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?
Dim myMaster As New {masterClassName}
myMaster.ErrorMessage = "Some Error Message."
.
- Follow-Ups:
- Prev by Date: Re: NEW Loop in SQL
- Next by Date: Re: How can I access a Master Page Public Property from a Base Page
- Previous by thread: exclusive connection error
- Next by thread: Re: How can I access a Master Page Public Property from a Base Page
- Index(es):
Relevant Pages
|
Loading