Language

IPostBackDataHandler.LoadPostData(String, NameValueCollection) メソッド

定義

クラスによって実装された場合、ASP.NET サーバー コントロールのポストバック データを処理します。

public:
 bool LoadPostData(System::String ^ postDataKey, System::Collections::Specialized::NameValueCollection ^ postCollection);
public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection);
abstract member LoadPostData : string * System.Collections.Specialized.NameValueCollection -> bool
Public Function LoadPostData (postDataKey As String, postCollection As NameValueCollection) As Boolean

パラメーター

postDataKey
String

コントロールのキー識別子。

postCollection
NameValueCollection

すべての受信名の値のコレクション。

返品

true ポストバックの結果としてサーバー コントロールの状態が変化する場合。それ以外の場合は false。

例

次のコード例は、 LoadPostData メソッドのバージョンを実装するサーバー コントロールを示しています。

public virtual bool LoadPostData(string postDataKey,
   NameValueCollection postCollection) {

   String presentValue = Text;
   String postedValue = postCollection[postDataKey];

   if (presentValue == null || !presentValue.Equals(postedValue)){
      Text = postedValue;
      return true;
   }
   return false;
}
Public Overridable Function LoadPostData(postDataKey As String, _
   postCollection As NameValueCollection) As Boolean
       
    Dim presentValue As String = Text
    Dim postedValue As String = postCollection(postDataKey)
       
    If (presentValue Is Nothing) OrElse (Not presentValue.Equals(postedValue)) Then 
        Text = postedValue
        Return True
    End If
    Return False
End Function

注釈

ASP.NET ページ フレームワークは、このメソッド呼び出しにtrueを返すすべてのサーバー コントロールを追跡し、それらのコントロールに対して RaisePostDataChangedEvent メソッドを呼び出します。

適用対象

こちらもご覧ください