communicating with Masterpage from UserControl

W

wildman

I have a Master page with property for ErrorMsgs. From my aspx pages I
can set that property resulting in a popup.

Whats the best way to have that same result from a user control. Say I
get an error in my usercontrol and I want to trip that popup in the
masterpage?

Thanks for any help or information.
 
W

wildman

I have a Master page with property for ErrorMsgs. From my aspx pages I
can set that property resulting in a popup.

Whats the best way to have that same result from a user control. Say I
get an error in my usercontrol and I want to trip that popup in the
masterpage?

Thanks for any help or information.


FYI.

On the pages I would add this below the directive:

<%@ MasterType VirtualPath="~/MyMaster.master" %>

But, I can't add that to the user control.

I can reference the master page from the user control with

Page.Master but my property (of the master) does not show up:

My property on the master looks like this:


Partial Class xxx
Inherits System.Web.UI.MasterPage

Public Property ErrorMsg() As String
Get
Return ErrorLabel.Text
End Get
Set(ByVal value As String)
ErrorLabel.Text = value
End Set
End Property


But Page.Master.ErrorMsg is say it's not a member of
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top