How to differentiate between site and subsite….!
Hi All, Today i want to share a piece of code which will differentiate between a site and subsite of sharepoint so here it is i think u will get benefit from it….!
For Each myweb In mysite.AllWebs ‘ This code papulates the comboBox with top level sites If (myweb.Webs.Count > 0) Or (myweb.IsRootWeb) Then ‘Check for top level site….!
TVAllsites.Nodes.Add(myweb.Title.ToString)End If Next
More over this is the code to exclude sharepoint central administration from list of virtual servers…!
TryFor Each spvs In spglobaladmin.VirtualServers If (spvs.ContentDatabases.Count > 0) Then ‘ Excludes central adminstration site
CmbVirtualServers.Items.Add(spvs.Url.ToString)End If Next Catch ex As Exception
- Posted in: SharePoint