The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
784 views

Get N Number of subwebs for specified web

How to get All Subwebs upto N Levels for Specified Web. eg. My Site url is... "http://server/web1" I need all subwebs upto N Levels for web1.. below line get all subwebs upto N Levels of ...
1
vote
3answers
108 views

How to get all SPWebs using visual studio?

I want to get all webs including it's subwebs. Eg. Site web1 subweb1 subweb2 web2 How to achieve ?
2
votes
2answers
685 views

SPWebCollection.Add gives exception “That assembly does not allow partially trusted callers.”

I created an assembly for SharePoint 2010, which is deployed into the GAC. It contains SPWebCollection.Add method. When the "STS#1" is used as template, there is no exception, the site is created ...
5
votes
1answer
316 views

Why does SPWebCollection[Guid] needs more permissions than SPWebCollection[string]?

I have this code: SPWeb web = SPContext.Current.Web; string dummy = String.Empty; SPWeb subwebByName = web.Webs["Example"]; dummy = subwebByName.Name; Guid subwebId = new ...
6
votes
3answers
3k views

Disposal of SPWebs retrieved from SPContext.Current.Site.AllWebs

As there was a minor disagreement on whether SPWebs retrieved from SPContext.Current.Site.AllWebs should be disposed, I thought it would be appropriate to post a new question and discuss it here. I ...
1
vote
5answers
1k views

for vs foreach when iterating over SPWebCollection

I was just wondering which of the two methods below is more popular, when it comes to iterating over a collection of SPWeb objects. for (int i = 0; i < SPContext.Current.Site.AllWebs.Count; i++) { ...