Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

How to remove the focus on quick launch bar in sharepoint site programatically

$
0
0

Hi,

I created the quick launch bar (left navigation area) in sharepoint site programatically using C#.

There is a problem: While loading the site, the focus is displayed in a link in quick launch . How to remove the focus on quick launch link programatically ? I dont want to show focus on any link on quick launch while loading the site.

Here is my code snippet

 foreach (SPNavigationNode heading in currentNodes)
                {
                    try
                    {
                        XmlTextReader textReader = new XmlTextReader(@"D:\test.xml");
                        if (textReader != null)
                        {
                            textReader.Read();

                            // If the node has value
                            while (textReader.Read())
                            {

                                if (textReader.NodeType == XmlNodeType.Element)
                                {
                                    //Reading the destination Site URL
                                    if (textReader.GetAttribute("Title") == heading.Title)
                                    {
                                        if (textReader.GetAttribute("Audience") == "Admin")
                                        {
                                            if (heading.Properties.Contains("Audience"))
                                            {
                                                heading.Properties["Audience"] = ";;;;" + grpAdmin;
                                            }
                                            else
                                            {
                                                heading.Properties.Add("Audience", ";;;;" + grpAdmin);
                                                heading.Parent.Properties["Audience"] = ";;;;" + grpAdmin;
                                            }
                                            Logs.WriteDetailsInLogFile("Setting Audience for: ", heading.Title + " Link to Admin group.", DestinationWeb.Title);
                                        }
                                        heading.Update();
                                      
                                        DestinationWeb.Update();
                                    }
                                }
                            }
                        }
                    }

Thanks


Knowledge is power.



Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>