IPostBackDataHandler.LoadPostData(String, NameValueCollection) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Parameters
- postDataKey
- String
The key identifier for the control.
- postCollection
- NameValueCollection
The collection of all incoming name values.
Returns
true
if the server control's state changes as a result of the postback; otherwise, false
.
Examples
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
Remarks
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.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기