473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

MasterPage Reference Problem

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?

Sep 24 '07 #1
3 1293
On Sep 24, 1:52 pm, mail747...@fificorp.net wrote:
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>

Sep 24 '07 #2
On Sep 24, 7:52 am, mail747...@fificorp.net wrote:
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(Para m1,
Param2)

-E
Sep 24 '07 #3
On 24 Sep, 19:53, Elroyskimms <elroyski...@yahoo.comwrote:
On Sep 24, 7:52 am, mail747...@fificorp.net wrote:
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(Para m1,
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.

Sep 27 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Leffe Andersson | last post by:
Hi folks! I have a MasterPage with some public methods, and I would like to call them from a (app_code) class. Is it possible to set a directive or an assembly reference to a MasterPage from a...
1
by: clintonG | last post by:
I'm having a problem with a label in a MasterPage which is not in a ContentPlaceHolder. The naughty label will not allow me to change its text property. <%-- renders the label's text directly to...
2
by: dawg1998 | last post by:
I am trying to access a label located in a MasterPage from a class located in my application's App_Code folder. The problem seems to be that the class cannot communicate with the MasterPage due to...
2
by: dawg1998 | last post by:
I have a page that creates dynamic textboxes based on the number of fields a user chooses to fill out. This process worked great when the page was standalone. However, when I move to a...
3
by: Alex Maghen | last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a MasterPage and the code that resides in the code-behind of the actual pages that USE that MasterPage. I'm noticing,...
5
by: Islamegy® | last post by:
In my project i have two master page which i change dynamic in runtime.. The first one with 1 ContentPanel "onepanel.master", the second with 2 contentPanel"twopanel.master".. but when i switch...
2
by: ThunderMusic | last post by:
Hi, Maybe there is another way of doing this, but here's my problem... I have my web site where I have a master page to have a common layout and a common behavior on all my pages (that's what...
0
by: Steve | last post by:
I'm developing an ASP.Net 2 web site using VS 2005 that is using a MasterPage with a Table on it. The table has three columns - each with contentPlaceHolder. After developing the MasterPage, I...
2
by: =?Utf-8?B?RGFsZQ==?= | last post by:
I have an app with a MasterPage. In the MasterPage is a user control with several public properties and methods that I want exposed to the content page. Rather than writing several redirection...
4
by: Torben Laursen | last post by:
I want to change the label of a component that I have on a masterpage but I cannot get my hands on it I have a mastepage MP2 that has a button called B2 masterpage MP2 uses masterpage MP1 that has...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.