IPostBackDataHandler.LoadPostData(String, NameValueCollection) Yöntem

Tanım

Bir sınıf tarafından uygulandığında, ASP.NET sunucu denetimi için geri gönderme verilerini işler.

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

Parametreler

postDataKey
String

Denetimin anahtar tanımlayıcısı.

postCollection
NameValueCollection

Tüm gelen ad değerlerinin koleksiyonu.

Döndürülenler

Boolean

true geri gönderme sonucunda sunucu denetiminin durumu değişirse; aksi takdirde , false.

Örnekler

Aşağıdaki kod örneği, yöntemin bir sürümünü LoadPostData uygulayan bir sunucu denetimini gösterir.

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

Açıklamalar

ASP.NET sayfa çerçevesi, bu yöntem çağrısına geri dönen true tüm sunucu denetimlerini izler ve ardından bu denetimlerde RaisePostDataChangedEvent yöntemini çağırır.

Şunlara uygulanır

Ayrıca bkz.