IPostBackDataHandler.LoadPostData(String, NameValueCollection) Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Wanneer deze worden geïmplementeerd door een klasse, worden postbackgegevens verwerkt voor een ASP.NET serverbeheer.
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
Parameters
- postDataKey
- String
De sleutel-id voor het besturingselement.
- postCollection
- NameValueCollection
De verzameling van alle binnenkomende naamwaarden.
Retouren
true als de status van het serverbeheer verandert als gevolg van de terugpost; anders, false.
Voorbeelden
In het volgende codevoorbeeld ziet u een serverbeheer waarmee een versie van de LoadPostData methode wordt geïmplementeerd.
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
Opmerkingen
Het ASP.NET paginaframework houdt alle serverbesturingselementen bij die true retourneren aan deze methode-aanroep en roept vervolgens de methode RaisePostDataChangedEvent aan op deze besturingselementen.