Avoid MasterPage to refresh

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tor Inge Rislaa

    Avoid MasterPage to refresh



    I have a MasterPage containing a TreeView menu. When clicking a menu item, a
    page is loaded into the ContentPlaceHol der. It seems like both the
    MasterPage and the page in the ContentPlaceHol der is refreshed when clicking
    the menu item. That might be how it is supposed to be, but the problem is
    that the menu in the masterpage returns to it's origin state where all the
    nodes are collapsed. Is there a way to avoid this from happening?



    TIRislaa




  • =?Utf-8?B?QnJhZCBSb2JlcnRz?=

    #2
    RE: Avoid MasterPage to refresh

    Be sure to only refresh/databind the treeview if "not IsPostback"
    and
    Enable ViewState on the treeview.

    Hope this helps
    --
    Brad

    "Software is like melted pudding..."


    "Tor Inge Rislaa" wrote:
    >
    >
    I have a MasterPage containing a TreeView menu. When clicking a menu item, a
    page is loaded into the ContentPlaceHol der. It seems like both the
    MasterPage and the page in the ContentPlaceHol der is refreshed when clicking
    the menu item. That might be how it is supposed to be, but the problem is
    that the menu in the masterpage returns to it's origin state where all the
    nodes are collapsed. Is there a way to avoid this from happening?
    >
    >
    >
    TIRislaa
    >
    >
    >
    >
    >

    Comment

    • Tor Inge Rislaa

      #3
      Re: Avoid MasterPage to refresh

      Thank you


      "Brad Roberts" <BradRoberts56n ojunk@hotmail.c omskrev i melding
      news:1329AFB0-A467-45B6-806E-E1C5ED3C513D@mi crosoft.com...
      Be sure to only refresh/databind the treeview if "not IsPostback"
      and
      Enable ViewState on the treeview.
      >
      Hope this helps
      --
      Brad
      >
      "Software is like melted pudding..."
      >
      >
      "Tor Inge Rislaa" wrote:
      >
      >>
      >>
      >I have a MasterPage containing a TreeView menu. When clicking a menu
      >item, a
      >page is loaded into the ContentPlaceHol der. It seems like both the
      >MasterPage and the page in the ContentPlaceHol der is refreshed when
      >clicking
      >the menu item. That might be how it is supposed to be, but the problem is
      >that the menu in the masterpage returns to it's origin state where all
      >the
      >nodes are collapsed. Is there a way to avoid this from happening?
      >>
      >>
      >>
      >TIRislaa
      >>
      >>
      >>
      >>
      >>

      Comment

      • Mark Rae

        #4
        Re: Avoid MasterPage to refresh

        "Tor Inge Rislaa" <tor.ingenospam @rislaa.nowrote in message
        news:et4ePUegHH A.4188@TK2MSFTN GP02.phx.gbl...
        I have a MasterPage containing a TreeView menu. When clicking a menu item,
        a page is loaded into the ContentPlaceHol der. It seems like both the
        MasterPage and the page in the ContentPlaceHol der is refreshed when
        clicking the menu item. That might be how it is supposed to be, but the
        problem is that the menu in the masterpage returns to it's origin state
        where all the nodes are collapsed. Is there a way to avoid this from
        happening?
        Brad has already answered your question, but it's important to understand
        what MasterPages are or, more importantly, what they're not...

        The biggest mistake people make concerning MasterPages is to imagine that
        they're somehow the clever ASP.NET equivalent of framesets...

        Judging by your phrase "When clicking a menu item, a page is loaded into the
        ContentPlaceHol der", I have a feeling that you may be falling into this
        trap...

        I can assure that when you click on a menu item, a page is absolutely not
        loaded into the ContentPlaceHol der - precisely the opposite!

        When you click on a menu item which redirects to another page, the entire
        page is rendered from the beginning. If the page in question happens to be a
        content page, then its MasterPage will be used to provide the "top and tail"
        of the eventual HTML which is streamed down to the client browser...

        A MasterPage isn't actually a page at all - it's just a special kind of
        UserControl.


        Comment

        Working...