Q. When running with SPSecurity.RunWithElevatedPrivileges (web context) what credentials are being used?
A. The App Pool Identity for the web application running SharePoint.
Q. When modifying a list item, what is the "main" difference between using SPListItem.Update() and SPListItem.SystemUpdate()?
A. Using SystemUpdate() will not create a new version and will also retain timestamps.
Q: When should you dispose SPWeb and SPSite objects? And even more important, when not?
A: You should always dispose them if you created them yourself, but not otherwise. You should never dispose SPContext.Current.Web/Site and you should normally not dispose SPWeb if IsRootWeb is true. More tricky constructs are things along the line of SPList.ParentWeb.
Bonus Points if the candidate knows Roger Lambs Blog Post.
Q: What is the difference between System.Web.UI.WebControls.WebParts.WebPart
and Microsoft.SharePoint.WebPartPages.WebPart
?
A: Microsoft.SharePoint.WebPartPages.WebPart
is provided in MOSS 2007 to provide backwards compatability with MOSS 2003 webparts. In MOSS 2007, it is recommended to use System.Web.UI.WebControls.WebParts.WebPart
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With