Wednesday, August 19, 2009

WebPart Notes

Here are some notes from building a SharePoint web part.
  • It seems when you deploy a feature containing web parts, you still have to add it to the web part gallery for each site.
  • If you want to reference controls in the CONTROLTEMPLATES directory, you can use the virtual path ~/_controltemplates.
  • If your controls have a code behind that is strong named, you must fully qualify the Inherits attribute of the @Control directive.
  • To remove broken webparts from a page, add the query string ?contents=1 to the URL. (Via http://sharepointinsight.blogspot.com/2008/06/remove-bad-or-broken-web-parts-from.html)
  • To disable friendly error messages (and see the yellow screen of death)
    • set the CallStack attribute of the SafeMode node to true
    • set CustomErrors mode attribute to Off
    • set debug attribute of the Compilation node to true

No comments: