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. Advertising

  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. Advertising

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.

Share This Page