Programmatically retrieve and update the target audience of global navigation menu in sharepoint 2013 RRS feed

  • Question

  • Hi,

    I have a sharepoint site with global navigation and created 5 menu's in that.I have set my custom sharepoint group as the target audience for each menu.

    Now i want to do 2 functionalities.

    1)Programmatically retrieve the target audience group names of each menu in global navigation.

    based on that i need to check the checkboxes automatically.

    2)Programmatically Update the target audience with new sharepoint group to menu in global navigation.

    This one is based on checkbox selection in gridview.

    Now am able to get the global navigation nodecollection using the below code.

               SPNavigationNodeCollection topnav = oSPWeb.Navigation.TopNavigationBar;
                foreach (SPNavigationNode node in topnav)
                    string name=node.Title;


    here name is displaying the menu name.

    But t want to see the sharepoint group name which is set as target audience for the menu.

    Please help.



    Wednesday, January 11, 2017 10:01 AM


All replies