IPostBackDataHandler.LoadPostData(String, NameValueCollection) IPostBackDataHandler.LoadPostData(String, NameValueCollection) IPostBackDataHandler.LoadPostData(String, NameValueCollection) IPostBackDataHandler.LoadPostData(String, NameValueCollection) Method

Definición

Cuando se implementa mediante una clase, se procesan los datos devueltos para un control de servidor ASP.NET.When implemented by a class, processes postback data for an ASP.NET server control.

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

Parámetros

postDataKey
String String String String

Identificador de clave del control.The key identifier for the control.

postCollection
NameValueCollection NameValueCollection NameValueCollection NameValueCollection

Colección de todos los valores de nombre entrantes.The collection of all incoming name values.

Devoluciones

true si el estado del control del servidor cambió a consecuencia del postback; en caso contrario, false.true if the server control's state changes as a result of the postback; otherwise, false.

Ejemplos

En el ejemplo de código siguiente se muestra un control de servidor que implementa una versión de la LoadPostData método.The following code example demonstrates a server control that implements a version of the LoadPostData method.

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

Comentarios

El marco de páginas ASP.NET realiza un seguimiento de todos los controles de servidor que devuelven true a esta llamada de método y, a continuación, invoca el RaisePostDataChangedEvent método en esos controles.The ASP.NET page framework tracks all the server controls that return true to this method call, and then invokes the RaisePostDataChangedEvent method on those controls.

Se aplica a

Consulte también: