Re: How can I access a Master Page Public Property from a Base Page



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?

.



Relevant Pages

  • Re: Two 3.0 paladin questions
    ... But that leads me to a corallery: if I cast ... two separate pools of hit points. ... If the master casts a cure wounds ... fashion, the master and familiar both have their own ability scores, ...
    (rec.games.frp.dnd)
  • Re: Two 3.0 paladin questions
    ... But that leads me to a corallery: if I cast ... two separate pools of hit points. ... If the master casts a cure wounds ... fashion, the master and familiar both have their own ability scores, ...
    (rec.games.frp.dnd)
  • Re: Steam chest without castings
    ... have great chunks of unmachined bronze. ... Surely this can be done in cast ... Harrison's Lilla has which has 1 1/2" bore cylinders. ... 'no-castings' master is Kozo Hiraoka whose step-by-step construction ...
    (uk.rec.models.engineering)
  • Re: Question about Feists Magician - American and UK versions
    ... here in the US, Feist's Magician is published in two books, Apprentice ... Can someone tell me if Master possesses a cast of characters? ...
    (rec.arts.sf.written)
  • Re: How can I access a Master Page Public Property from a Base Page
    ... Public Property ErrorMessage() As String ... If I try and access the Master Page Property from an inherited Base Page with: ...
    (microsoft.public.dotnet.framework.aspnet)