SPWeb is a single website in SharePoint residing in a Site Collection (SPSite).
9
votes
1answer
428 views
Is it necessary to call SPWeb.Update() after setting AllowUnsafeUpdates?
Amidst working on resolving this issue, there's something I was curious about, and something that I've been very inconsistent about in my code.
If you enable SPWeb.AllowUnsafeUpdates = true, do you ...
3
votes
3answers
844 views
How to create Site (SPWeb) on Sharepoint Online
I have a problem creating Sites on Sharepoint Online. The code that works on-premise do not work on Sharepoint Online.
I do not want to bother you with the code, i just want a clean start.
So my ...
3
votes
5answers
2k views
Disposal of SPWebs created using SPSite.OpenWeb()
After reading some answers/comments on Disposal of SPWebs retrieved from SPContext.Current.Site.AllWebs, I opened up Reflector to dig deeper into the SPSite and SPWeb classes.
I ran into a surprise, ...
3
votes
2answers
2k views
How to access a file in the current url or _layouts folder?
My code behind code from the aspx webpage uses a transform.xsl to do some custom xslt transformation.
Scenario 1: Try to get the file from the _layouts folder.
SPWeb web = SPContext.Current.Web;
...
0
votes
3answers
277 views
SPSite and SPWeb object dispose inside foreach loop
I have a code that loops through all the Sites and Webs in a web application. My code uses for..each loop to navigate through each site and web object.
I was wondering if we are required to dispose ...
4
votes
2answers
5k views
Using SPContext.Current to get public URL of the current zone
I have a single content Web application in the Default zone of my MOSS 2007 farm, which I then extended to the Extranet zone. The default zone web application uses Windows authentication and standard ...
1
vote
1answer
621 views
SPWeb.GetListItem returns null in custom workflow activity
I created an custom workflow activity with the following code:
namespace Custom.SharePoint
{
public class CustomActivity : Activity
{
#region Fields
public static readonly ...
0
votes
1answer
226 views
Dispose SPWeb object in recursive function
I have updated my code as per suggestions from suggestions on my earlier question , I still see the error message for one of my recursive function.
Below is the code snippet to recursively loop ...