Q&A

Q. Can I use SharePoint Manager to modify object properties?

A. Although SharePoint Manager is a handy tool and allows modification of certain object properties as well, this should generally be avoided. Always go via Central Administration or site settings for any modifications or configuration changes. It is easy to mess up your SharePoint installation via random and unplanned updates done using SharePoint Manager.

Q. Can I keep the AllowUnsafeUpdates always set to true to tackle any access related errors?

A. The idea behind AllowUnsafeUpdates is to protect you from cross-site scripting attacks. While at times it is lucrative to set it to true to escape debugging any access related errors, doing so would expose you to XSS attacks. Therefore, enable unsafe updates very selectively and only under exceptional circumstances.

Q. Why do I have to worry about disposing objects when Garbage Collector is there to work for me?

A. Although garbage collection will definitely set in at some stage to destroy the objects no longer in use, this will cause the unused objects to be retained for the long term in memory, leading to poor system performance. Therefore, as a best practice try to explicitly call Dispose on disposable objects to free up unmanaged resources as soon as possible after use and also to indicate an object’s availability for garbage collection.

Q. I was able to get the WebProvisioned event receiver working, but the WebDeleting event receiver refuses to trigger. Did I miss something?

A. When provisioning a new subsite, the web provisioned event receiver for the current site gets triggered as expected. However, now when you try to delete the subsite, it is the subsite’s web deleting event receiver that is triggered and not the parent site one. Hence you should reassociate your event receiver with every newly provisioned site for this to work. In our discussion on event receivers we try to achieve this by activating the feature responsible for event receiver registration for every newly provisioned site, which does the trick.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.119.199