MasterPage Reference Problem

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?
 
G

Guest

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>
 
E

Elroyskimms

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
 
M

mail747097

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.
 

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

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top