How to get to master master method?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NirBE

    #1

    How to get to master master method?

    Hi,

    I have few master pages on my site in this hierarchy:
    global.master -> middle.master, middle2.master etc... -> web pages(.aspx)

    On the web pages code I'm trying to do:

    Master.Master.m ethod();

    In purpose to get to the method that locate on global.master. But I get this errors:
    Code:
    Error	26	The type 'ASP.global_master' is defined in an assembly that is not referenced. You must add a reference to assembly 'App_Web__jpncjmo, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
    Error	27	'ASP.global_master' does not contain a definition for 'method' and no extension method 'method' accepting a first argument of type 'ASP.global_master' could be found (are you missing a using directive or an assembly reference?)
  • khurramzeb
    New Member
    • Oct 2010
    • 8

    #2
    You need to create an object of Global master page and then call the function of Global Master Page.

    i-e if your gloabal master page is global.master and there is a function public void Test()

    so to use this function in your aspx page you have to write the code as

    global obj=new global();
    obj.Test();

    hope it will solve your problem.

    Comment

    Working...