WebPartManager.ExportSensitiveDataWarning プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > WebPartManager.ExportSensitiveDataWarning プロパティの意味・解説 

WebPartManager.ExportSensitiveDataWarning プロパティ

メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。

ユーザーが WebPart コントロールから重要な状態情報をエクスポートしようとしたときに表示される警告メッセージのテキストを取得または設定します。

名前空間: System.Web.UI.WebControls.WebParts
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Overridable Property
 ExportSensitiveDataWarning As String
Dim instance As WebPartManager
Dim value As String

value = instance.ExportSensitiveDataWarning

instance.ExportSensitiveDataWarning = value
public virtual string ExportSensitiveDataWarning
 { get; set; }
public:
virtual property String^ ExportSensitiveDataWarning {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_ExportSensitiveDataWarning ()

/** @property */
public void set_ExportSensitiveDataWarning
 (String value)
public function get ExportSensitiveDataWarning
 () : String

public function set ExportSensitiveDataWarning
 (value : String)

プロパティ値
警告メッセージが含まれた文字列。既定のメッセージは、.NET Framework が提供するカルチャ固有の値です。

解説解説
使用例使用例

ExportSensitiveDataWarning プロパティを宣言によって使用するコード例を次に示します。

次の Web ページのコードは、標準の BulletedList コントロールをゾーン内に配置して使用します。このコントロールは実行時に GenericWebPart コントロールでラップされるため、真の WebPart コントロールとして動作できます。コントロールをエクスポートできるようにするには、ExportMode 属性を <asp:bulletedlist> 要素に追加し、その属性値を All に設定します。これにより、重要情報と重要ではない情報の両方をエクスポートできます。また、<asp:webpartmanager> 要素では、ExportSensitiveDataWarning 属性にカスタム値を割り当てます。

コード例が機能するには、Web.config ファイルに設定を追加して、Web パーツ記述ファイルをエクスポートできるようにする必要があります。このコード例の Web ページと同じディレクトリ内に Web.config ファイルがあることを確認してください。<system.web> セクション内に、次のマークアップのように、true に設定された enableExport 属性を持つ <webParts> 要素があることを確認します。

<webParts enableExport="true">

...

</webParts>

<%@ Page Language="vb" %>

<html  >
<head id="Head1" runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:WebPartManager ID="WebPartManager1"
 runat="server" />
      <asp:WebPartManager ID="WebPartManager2"
 
        runat="server" 
        ExportSensitiveDataWarning="Sensitive data is being exported"/>
        <ZoneTemplate>
          <asp:BulletedList 
            DisplayMode="HyperLink" 
            ID="BulletedList1" 
            runat="server"
            Title="My Links"
            ExportMode="All">
            <asp:ListItem Value="http://www.microsoft.com">
            Microsoft
            </asp:ListItem>
            <asp:ListItem Value="http://www.msn.com">
            MSN
            </asp:ListItem>
            <asp:ListItem Value="http://www.contoso.com">
            Contoso Corp.
            </asp:ListItem>
          </asp:BulletedList> 
        </ZoneTemplate>
      </asp:WebPartZone>
     </form>
</body>
</html>
<%@ Page Language="C#" %>

<html  >
<head runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:WebPartManager ID="WebPartManager1" 
        runat="server" 
        ExportSensitiveDataWarning="Sensitive data is being exported"/>
      <asp:WebPartZone ID="WebPartZone1" runat="server">
        <ZoneTemplate>
          <asp:BulletedList 
            DisplayMode="HyperLink" 
            ID="BulletedList1" 
            runat="server"
            Title="My Links"
            ExportMode="All">
            <asp:ListItem Value="http://www.microsoft.com">
            Microsoft
            </asp:ListItem>
            <asp:ListItem Value="http://www.msn.com">
            MSN
            </asp:ListItem>
            <asp:ListItem Value="http://www.contoso.com">
            Contoso Corp.
            </asp:ListItem>
          </asp:BulletedList> 
        </ZoneTemplate>
      </asp:WebPartZone>
     </form>
</body>
</html>

ブラウザにページを読み込んだ後、リンクが含まれたコントロールのタイトル バーにある動詞メニュー (下向きの矢印で表示) をクリックします。動詞メニューで、[エクスポート] を選択し、メッセージ ボックスにカスタム警告が表示されることを確認します。エクスポートを継続する場合は、[OK] をクリックすると、そのコントロールに関するすべてのデータを XML 記述ファイルのローカル コピーに保存できます。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebPartManager クラス
WebPartManager メンバ
System.Web.UI.WebControls.WebParts 名前空間
WebPart.ExportMode プロパティ
ExportWebPart
その他の技術情報
ASP.NET Web パーツ ページ



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

WebPartManager.ExportSensitiveDataWarning プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebPartManager.ExportSensitiveDataWarning プロパティのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS