On Feb 26, 7:16 am, wild...@noclient.net wrote:
> RE: Accessing MasterPage Properties from a usercontrol on a
> contentpage??
>
> On my master page's codebehind I have this property:
>
> Public Property ErrorMsg() As String
> Get
> Return ErrorLabel.Text
> End Get
> Set(ByVal value As String)
> ErrorLabel.Text = value
> End Set
> End Property
>
> I've got this on the contentpage,
>
> <%@ MasterType VirtualPath="ShapeUp.master" %>
>
> and I confirmed I can can set the property from the content page.
>
> However on my content page, I have a user control
>
> From inside that user control, I can see all the other properties from
> Page.Master , but not ErrorMsg I created on the master page
> codebehind.
>
> Also, I've tried this, but it does not work
>
> Dim errorMsg As Label = CType(Page.Master.FindControl("ErrorMsg"),
> Label)
> errorMsg.Text = "xxxx"
>
> Do I have no choice but to code event handling?
>
> Thanks for any help or information.
Hi...
did you tried casting the Page.Master to your class
code in c# will look like this
string msg = (Page.Master as ShapeUp).ErrorMsg;
Masudur
www.munna.shatkotha.com
www.shatkotha.com