Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to access basepage methods from masterpage??

how to access basepage methods from masterpage??

Scheduled Pinned Locked Moved ASP.NET
questionhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lnong
    wrote on last edited by
    #1

    I have these pages: 1) DefaultMaster.Master/cs 2) MyPage.aspx/cs 3) BasePage.cs MyPage.aspx is set to use the DefaultMaster masterpage. MyPage.cs inherits BasePage class (which is derived from the Page class). How can I access methods and properties of the BasePage class from the DefaultMaster.Master.cs codebehind? I cannot find the right syntax to do it. Please help...

    C 1 Reply Last reply
    0
    • L lnong

      I have these pages: 1) DefaultMaster.Master/cs 2) MyPage.aspx/cs 3) BasePage.cs MyPage.aspx is set to use the DefaultMaster masterpage. MyPage.cs inherits BasePage class (which is derived from the Page class). How can I access methods and properties of the BasePage class from the DefaultMaster.Master.cs codebehind? I cannot find the right syntax to do it. Please help...

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I assume the master page has a property that gives you the page, you then need to cast that to the BasePage type, preferably using the 'as' keyword and checking first that the cast succeeded.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups