Saturday, March 29, 2008

Ajax based Dynamic User Control for Menu from Master Page in MOSS 2007 Site

Hi All,

I had an interesting requirement in one of my previous project. A single control (user control) will display the Menu appropriate to the respective page the user has browsed currently. Moreover, in future if any new page is added to the site by site-administrator. The Menu automatically gets updated & display with the new link added.

For example, the classification in the website is like below.

Home
    A Page
        A1 Page
          A11 Page
          A12 Page
        A2 Page
          A21 Page
    B Page
        B1 Page
        B2 Page
          B21 Page
          B22 Page

So when the user is in section-A either in page A or page A12 He will be seeing the Menus built for all the links in A Section & in case if he is in Section-B, all the available page in B section are shown to him in menu.

In addition, there are many branches similar to the hierarchy shown above & this functionality is achieved with a single User control, which binds dynamically. The Ajax based dynamic user control for the menu is placed in Master page of the site so that it is available in all the pages & you can view the above-mentioned functionality implemented in
www.kockw.com

The Steps to implement & the source code of the user control is placed in the document URL given below.

Elaborated Description for IE users

Elaborated Description for Firefox users

Any queries regarding implementation are welcome...

Thanks
Fauzi

No comments: