Changing a Master Sheet control when navigating between content pages

Discussion in 'ASP .Net' started by Stratum, Jun 25, 2007.

  1. Stratum

    Stratum Guest

    It's an old question, and I apologize for raising it again.

    I use ImageButton objects on my ASP.Net master page to navigate to
    content pages. For each button, I have two images.
    One image shows black print on a white background, and
    the other image shows the same printing in white
    on a red background to indicate the content page
    which is presently loaded.

    When I navigate between pages, I want the
    images on the new content page and the old
    content page to change. If I use a
    button_click event handler in the master
    page code-behind (C#), this effect unfortunately
    does *not* occur. Apparently, the new content
    page is being loaded before the button images
    change, and the newly loaded page doesn't
    know this.

    Anyone know the solution? Seems I've had this
    problem before and figured out the fix, but I
    no longer have access to the source.
     
    Stratum, Jun 25, 2007
    #1
    1. Advertising

  2. Stratum

    Masudur Guest

    On Jun 25, 9:54 am, Stratum <> wrote:
    > It's an old question, and I apologize for raising it again.
    >
    > I use ImageButton objects on my ASP.Net master page to navigate to
    > content pages. For each button, I have two images.
    > One image shows black print on a white background, and
    > the other image shows the same printing in white
    > on a red background to indicate the content page
    > which is presently loaded.
    >
    > When I navigate between pages, I want the
    > images on the new content page and the old
    > content page to change. If I use a
    > button_click event handler in the master
    > page code-behind (C#), this effect unfortunately
    > does *not* occur. Apparently, the new content
    > page is being loaded before the button images
    > change, and the newly loaded page doesn't
    > know this.
    >
    > Anyone know the solution? Seems I've had this
    > problem before and figured out the fix, but I
    > no longer have access to the source.



    hi...

    check out this post
    http://groups.google.com/group/micr...rol from content page&rnum=3#bfd7eda8c42d10f0

    Thanks
    Masudur
    http://munnacs.110mb.com/
     
    Masudur, Jun 25, 2007
    #2
    1. Advertising

  3. Stratum

    Stratum Guest

    Re: Changing a Master Sheet control when navigating between contentpages

    Masudur wrote:
    > On Jun 25, 9:54 am, Stratum <> wrote:
    >
    >>It's an old question, and I apologize for raising it again.
    >>
    >>I use ImageButton objects on my ASP.Net master page to navigate to
    >>content pages. For each button, I have two images.
    >>One image shows black print on a white background, and
    >>the other image shows the same printing in white
    >>on a red background to indicate the content page
    >>which is presently loaded.
    >>
    >>When I navigate between pages, I want the
    >>images on the new content page and the old
    >>content page to change. If I use a
    >>button_click event handler in the master
    >>page code-behind (C#), this effect unfortunately
    >>does *not* occur. Apparently, the new content
    >>page is being loaded before the button images
    >>change, and the newly loaded page doesn't
    >>know this.
    >>
    >>Anyone know the solution? Seems I've had this
    >>problem before and figured out the fix, but I
    >>no longer have access to the source.

    >
    >
    >
    > hi...
    >
    > check out this post
    > http://groups.google.com/group/micr...rol from content page&rnum=3#bfd7eda8c42d10f0
    >
    > Thanks
    > Masudur
    > http://munnacs.110mb.com/
    >


    Thank *you*, Masudur! Your response led to a good solution.
    In brief, I needed a way to reference master page controls
    inside content pages that use the master. I'll repeat
    it here (if only for my own future reference!)...

    You have a master page, MyMaster.master, with class

    public partial class MyMaster : System.Web.UI.MasterPage


    In this class, you expose public properties or methods.

    Then, in a content page, you use the Reference directive,

    <%@ Reference Control = "~/MyMaster.master" %>

    In the content page's code-behind (I use C#), you have
    something like,

    (MyMaster)myMasterPage = (MyMaster) this.Page.Master;

    Then the public objects in myMasterPage are exposed in
    this content page.

    J
     
    Stratum, Jun 25, 2007
    #3
    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.
Similar Threads
  1. Replies:
    1
    Views:
    3,250
    PeterKellner
    May 16, 2006
  2. Replies:
    0
    Views:
    740
  3. mimoh

    Navigating between pages

    mimoh, Aug 15, 2006, in forum: Java
    Replies:
    0
    Views:
    404
    mimoh
    Aug 15, 2006
  4. vikramp
    Replies:
    3
    Views:
    745
    vikramp
    Oct 13, 2006
  5. jobs
    Replies:
    1
    Views:
    476
    clintonG
    Dec 13, 2006
Loading...

Share This Page