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 NextMore over this is the code to exclude sharepoint central administration from list of virtual servers…!
Try
For Each spvs In spglobaladmin.VirtualServers If (spvs.ContentDatabases.Count > 0) Then ‘ Excludes central adminstration siteCmbVirtualServers.Items.Add(spvs.Url.ToString)
End If Next Catch ex As ExceptionMsgBox(ex.ToString)
End Try- Posted in: SharePoint
Recent Comments