Accessing function in master page from content page

Last post 11-30-2005 5:19 AM by perini14. 2 replies.

Sort Posts:

  • Accessing function in master page from content page

    11-30-2005, 4:58 AM
    • Member
      75 point Member
    • perini14
    • Member since 09-17-2003, 2:24 AM
    • Posts 20
    Hello,
    I've written a function in master page class and want to use it in content page.
    Master page:
    Partial public class sitemaster
        inherits system.web.ui.masterpage
       public mystring as string
        public function abc(byval param1 as string) as string
        ....
        end function
    end class

    Content page:
    Protected sub page_load (s as object, e as system.eventargs)
       master.abc("aaa")
    end sub

    I'm getting this warning:
    abc is not a member of system.web.ui.masterpage

    The same if I try to access the public variable "mystring".
    What I'm doing wrong ?

    Thanks.
  • Re: Accessing function in master page from content page

    11-30-2005, 5:00 AM
    • All-Star
      29,644 point All-Star
    • Fredrik N
    • Member since 06-22-2002, 5:03 AM
    • Sweden
    • Posts 5,334
    • TrustedFriends-MVPs
    /Fredrik Normén - fredrikn @ twitter

    ASPInsider

    Microsoft MVP, MCSD, MCAD, MCT

    ASPInsiders
    My Blog
  • Re: Accessing function in master page from content page

    11-30-2005, 5:19 AM
    • Member
      75 point Member
    • perini14
    • Member since 09-17-2003, 2:24 AM
    • Posts 20

    Thank you !!!

     

Page 1 of 1 (3 items)