"この Web パーツのすべてのプロパティ設定を保存できません。既定の名前空間 " http://schemas.microsoft.com/WebPart/v2 " は、基本 Web パーツ プロパティ用に予約された名前空間です。カスタム Web パーツ プロパティには一意の名前空間が必要です (プロパティの XmlElementAttribute、またはクラスの XmlRootAttribute を介して指定されます)」。
このエラーに関するヘルプはどこで入手できますか?
これは、Web パーツにカスタム プロパティを追加するときです。Web パーツを編集して [保存/適用] をクリックすると、プロパティを保存できないのはなぜですか? (その後、そのエラーが発生します)
コード -
[DefaultProperty("Text"), ToolboxData("<{0}:CustomPropertyWebPart runat=server></{0}:CustomPropertyWebPart>"),
XmlRoot(Namespace = "ExecuteStoreProc")]
public class CustomPropertyWebPart : Microsoft.SharePoint.WebPartPages.WebPart
{
const string c_MyStringDefault = "Sample String";
}
// Create a custom category in the property sheet.
[Category("Custom Properties")]
// Assign the default value.
[DefaultValue(c_MyStringDefault)]
// Property is available in both Personalization
// and Customization mode.
[WebPartStorage(Storage.Personal)]
// The caption that appears in the property sheet.
[FriendlyNameAttribute("Custom String")]
// The tool tip that appears when pausing the mouse pointer over
// the friendly name in the property pane.
[Description("Type a string value.")]
// Display the property in the property pane.
[Browsable(true)]
[XmlElement(ElementName = "MyString")]
// The accessor for this property.
public string MyString
{
get
{
return _myString;
}
set
{
_myString = value;
}
}