SharepointTips


Sharepoint Dev And Configuration

Dott. Pasquale Pannuto
(Senior Developer)
TS: Microsoft .NET Framework - Application Development Foundation
MCTS: Microsoft Office SharePoint Server 2007, Configuration
PRO: Designing and Developing Microsoft SharePoint 2010 Applications
TS: SharePoint 2010, Application Development


<script type="text/javascript"><!--
google_ad_client = "ca-pub-7328846173515313";
/* Google */
google_ad_slot = "4019879245";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Ottenere lista dei SiteMapNode, impostati "Hidden" dal Navigator di Sharepoint

Il codice che segue crea una lista degli  oggetti "Hidden" definiti nel current web.

Codice :

string GlobalNavigationExcludes = (string)SPContext.Current.Web.
AllProperties["__GlobalNavigationExcludes"];
            Hashtable ReturnExcludedUrls = new Hashtable();

            if (!String.IsNullOrEmpty(GlobalNavigationExcludes))
            {
                string[] ExcludedGuids = GlobalNavigationExcludes.Split(';');

                for (int i = 0; i < ExcludedGuids.Length - 1; i++ )
                {
                    string guid = ExcludedGuids[i];
                    Guid ExcludedGuid = new Guid(guid);

                    try
                    {
                        SPWeb SubWeb = SPContext.Current.Web.Webs[ExcludedGuid];
                        ReturnExcludedUrls.Add(SubWeb.ServerRelativeUrl, "");
                    }
                    catch (Exception e1)
                    {
                        try
                        {
                            SPListItem Page = SPContext.Current.Web.Lists["Pages"].Items[ExcludedGuid];
                            string ExcludedURL = String.Concat(SPContext.Current.Web.ServerRelativeUrl, "/", Page.Url);
                            ReturnExcludedUrls.Add(ExcludedURL, "");
                        }
                        catch (Exception e2)
                        { }
                    }
                }
           
        }


Categoria: -
lunedì, 14 dic 2009 Ore. 19.37
Statistiche
  • Views Home Page: -549
  • Views Posts: 56.039
  • Views Gallerie: 2
  • n° Posts: 64
  • n° Commenti: 3
Calendario
aprile 2024
lmmgvsd
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003