Difference between revisions of "MOSS 2007"

From Richard's Wiki
Jump to: navigation, search
(SharePoint 2010 Snippets)
(SharePoint 2010 Snippets)
Line 40: Line 40:
 
* [http://dotnet.sys-con.com/node/1299753 Deploying an External List via Feature Using CAML (SP2010)]
 
* [http://dotnet.sys-con.com/node/1299753 Deploying an External List via Feature Using CAML (SP2010)]
 
* [http://msdn.microsoft.com/en-us/library/dd584174(office.11).aspx Creating a Web Part with Custom Properties]
 
* [http://msdn.microsoft.com/en-us/library/dd584174(office.11).aspx Creating a Web Part with Custom Properties]
 +
* To add a custom property to an SP2010 web part, add the following to the WebPart.cs source code file, the one which extends System.Web.UI.WebControls.WebParts.WebPart (see [http://httpcode.com/blogs/PermaLink,guid,357e4853-9a75-4962-ad68-1e07bcf40bb8.aspx SharePoint 2010 Visual Web Parts]
 +
<code>
 +
[System.Web.UI.WebControls.WebParts.WebBrowsable(true)]
 +
[System.Web.UI.WebControls.WebParts.WebDisplayName("Custom Property")]
 +
[System.Web.UI.WebControls.WebParts.WebDescription("A test Custom property.")]
 +
[System.Web.UI.WebControls.WebParts.Personalizable(PersonalizationScope.User)]
 +
[System.ComponentModel.Category("Settings")]
 +
[System.ComponentModel.DefaultValue("Default String Value")]
 +
public string CustomProp { get; set; }
 +
</code>
  
 
=== SharePoint 2010 & Silverlight ===
 
=== SharePoint 2010 & Silverlight ===

Revision as of 23:42, 6 April 2010

Some MOSS Resources

MOSS & Silverlight

SharePoint 2010 Resources

SharePoint 2010 Snippets

[System.Web.UI.WebControls.WebParts.WebBrowsable(true)]
[System.Web.UI.WebControls.WebParts.WebDisplayName("Custom Property")]
[System.Web.UI.WebControls.WebParts.WebDescription("A test Custom property.")]
[System.Web.UI.WebControls.WebParts.Personalizable(PersonalizationScope.User)]
[System.ComponentModel.Category("Settings")]
[System.ComponentModel.DefaultValue("Default String Value")]
public string CustomProp { get; set; }

SharePoint 2010 & Silverlight

stsadm -o setproperty -pn developer-dashboard -pv OnDemand

  • In VS2010, can make the following changes to
    • Elements.xml: change the
      <Property Name="Group" Value="Custom" />
      to something other than Custom.
    • Webpart.webpart (webPartIcon is 16x16):
  <property name="ChromeType" type="chrometype">TitleAndBorder</property>
  <property name="CatalogIconImageUrl" type="string">_layouts/images/ContosoWebParts/WebPartIcon.gif</property>
  <property name="TitleIconImageUrl" type="string">_layouts/images/ContosoWebParts/WebPartIcon.gif</property>
    • Elements.xml, modify the URL attribute of File element to change the .webpart file name to ensure that it is unique. Do this by prepending the text value of "ContosoWebParts_" (ie Feature project name) to the beginning of the URL property value.