HtmlSelect.LoadPostData(String, NameValueCollection) 方法
定义
处理 HtmlSelect 控件的回发数据。Processes the postback data for the HtmlSelect control.
protected:
virtual bool LoadPostData(System::String ^ postDataKey, System::Collections::Specialized::NameValueCollection ^ postCollection);
protected virtual bool LoadPostData (string postDataKey, System.Collections.Specialized.NameValueCollection postCollection);
abstract member LoadPostData : string * System.Collections.Specialized.NameValueCollection -> bool
override this.LoadPostData : string * System.Collections.Specialized.NameValueCollection -> bool
Protected Overridable Function LoadPostData (postDataKey As String, postCollection As NameValueCollection) As Boolean
参数
- postDataKey
- String
控件的主要标识符。The key identifier for the control.
- postCollection
- NameValueCollection
所有传入名称值的集合。The collection of all incoming name values.
返回
如果 HtmlSelect 控件的状态已因回发而更改,则为 true;否则为 false。true if the HtmlSelect control's state has changed as a result of a postback; otherwise, false.
例外
SelectedIndex 属性被设置为大于 HtmlSelect 控件中的项数或小于 -1 的值。The SelectedIndex property was set to a value greater than the number of items in the HtmlSelect control or less than -1.
注解
LoadPostData方法检查控件的回发数据是否与 HtmlSelect 以前的值不同,如果是,则返回 true 。The LoadPostData method checks whether the postback data of the HtmlSelect control is different from its previous value, and if so, returns true. 如果 HtmlSelect 控件的 Multiple 属性为 false ,则指示单个选择 HtmlSelect 控件,则 LoadPostData 方法会检查 SelectedIndex 属性。If the HtmlSelect control's Multiple property is false, indicating a single-selection HtmlSelect control, then the LoadPostData method checks the SelectedIndex property. 如果 HtmlSelect 控件的 Multiple 属性为 true ,则指示多选 HtmlSelect 控件,则 LoadPostData 方法会检查 SelectedIndices 属性。If the HtmlSelect control's Multiple property is true, indicating a multiple-selection HtmlSelect control, then the LoadPostData method checks the SelectedIndices property.
LoadPostData方法主要由控件开发人员用来扩展控件的功能 HtmlSelect 。The LoadPostData method is used primarily by control developers extending the functionality of the HtmlSelect control.