MasterPage Reference Problem

  • Thread starter Thread starter mail747097
  • Start date Start date
M

mail747097

In VS.NET 2005 I have created a web site with a MasterPage and a
function. I have then created a new folder and put a WebUserControl in
it. How do I access my function in the MasterPage from the
WebUserControl?
 
In VS.NET 2005 I have created a web site with a MasterPage and a
function. I have then created a new folder and put a WebUserControl in
it. How do I access my function in the MasterPage from the
WebUserControl?

Dim myMaster As New <nameofmasterpage>
 
In VS.NET 2005 I have created a web site with a MasterPage and a
function. I have then created a new folder and put a WebUserControl in
it. How do I access my function in the MasterPage from the
WebUserControl?

You could also try:
ctype(me.master, MyMasterPageClassName).MasterPageFunctionName(Param1,
Param2)

-E
 
You could also try:
ctype(me.master, MyMasterPageClassName).MasterPageFunctionName(Param1,
Param2)

-E

The problem is that the type (nameofmasterpage or
MyMasterPageClassName) is not available in the user control.
I have found the directive <%@ MasterType VirtualPath="~/masters/
SourcePage.master"" %> but it cannot be used in a user control. I have
solved the problem by creating a base class that the master page
inherits from. But it would be better if I could access the master
page itself.
 
Back
Top