0

"この 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;
            }
        }
4

1 に答える 1

0

[サイトの設定] > [ギャラリー] > [Web パーツ] > [新規] に移動してみてください

正しく入力されている場合は機能しており、それ以外の場合は Web パーツにエラーがあります。

Web パーツを追加する Web ページに戻り、ギャラリーで選択して Web パーツを追加してみます。

これが機能する場合 (ページに追加できた場合)、Web パーツ ギャラリー ([サイトの設定] > [ギャラリー] > [Web パーツ]) に追加された Web パーツを開き、自分の .dwp ファイルと比較して、どこが間違っていたかを確認できます。

お役に立てれば

于 2013-05-21T11:29:24.653 に答える