New answers tagged spweb
In the code you've posted, it is unnecessary. In fact, using AllowUnsafeUpdates is very rarely appropriate.
Yes, it's acceptable to do what you have done. It's also ok to pass that web object to other functions. See a detailed article on this subject from Microsoft here.
The code you written is Ok. using statement will dispose the SPWeb object you have instantiated. Parent Site - This object is not initiantiated by you, you are using SPSite that belongs to SPContext. SPContext objects are managed by the SharePoint framework and should not be explicitly disposed in your code. This is true also for the SPSite and SPWeb ...
No. There is no reason to use unsafe updates in your scenario.
Yes, you will need need to use AllowUnsafeUpdates = true, and afterwards, AllowUnsafeUpdates = false - this is to prevent your from cross-site scripting attacks. SPWeb.AllowUnsafeUpdates : Gets/Sets a Boolean value that specifies whether to allow updates to the database as a result of a GET request or without requiring a security validation. Whenever your ...
Yes, it will delete the web from the Database. But you will not get the space back just with this action. Once something removed from the DB it will not reduced by size rather the white space(unused Space) increased. I think, you have to shrink the database to get the space back(reduce the size of content DB). their is one rule in the health n monitor ...
Top 50 recent answers are included