Fire content code from master page

Discussion in 'ASP .Net' started by DavidC, Feb 8, 2010.

  1. DavidC

    DavidC Guest

    Is it possible to have a Menu item that is in a master page fire code that
    resides in the content page code-behind? For example, I have an aspx page
    and a aspx.vb page and would like to run code in the aspx.vb page from the
    master page when clicking on a MenuItem in a menu control. Thanks.
    --
    David
     
    DavidC, Feb 8, 2010
    #1
    1. Advertisements

  2. On Feb 8, 5:28 pm, DavidC <> wrote:
    > Is it possible to have a Menu item that is in a master page fire code that
    > resides in the content page code-behind?  For example, I have an aspx page
    > and a aspx.vb page and would like to run code in the aspx.vb page from the
    > master page when clicking on a MenuItem in a menu control.  Thanks.
    > --
    > David


    Hi David,

    yes, you can do it by using CallByName() function

    http://www.codeproject.com/KB/aspnet/Master_and_Contents.aspx
    http://msdn.microsoft.com/en-us/library/chsc1tx6.aspx

    But don't make it too complex. Just put your code into the vb-module
    and use it from both, masterpage and content page.

    Hope this helps
     
    Alexey Smirnov, Feb 8, 2010
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug McCann
    Replies:
    1
    Views:
    1,418
    William Brogden
    Aug 5, 2004
  2. hazz
    Replies:
    6
    Views:
    52,121
    SkyUCHC
    Jun 9, 2010
  3. Replies:
    0
    Views:
    884
  4. Laith Zraikat
    Replies:
    3
    Views:
    1,463
    Walter Wang [MSFT]
    Jul 6, 2006
  5. Rolf Welskes
    Replies:
    7
    Views:
    1,229
    Steven Cheng[MSFT]
    Aug 22, 2006
  6. Zeba
    Replies:
    1
    Views:
    746
    Mark Rae
    Feb 22, 2007
  7. John
    Replies:
    2
    Views:
    1,139
  8. Replies:
    1
    Views:
    1,468
Loading...