IBindableTemplate.ExtractValues(Control) 方法


通过类来实现时,使用模板化内容中的双向 ASP.NET 数据绑定语法对绑定值的一组名称/值对进行检索。When implemented by a class, retrieves a set of name/value pairs for values bound using two-way ASP.NET data-binding syntax within the templated content.

 System::Collections::Specialized::IOrderedDictionary ^ ExtractValues(System::Web::UI::Control ^ container);
public System.Collections.Specialized.IOrderedDictionary ExtractValues (System.Web.UI.Control container);
abstract member ExtractValues : System.Web.UI.Control -> System.Collections.Specialized.IOrderedDictionary
Public Function ExtractValues (container As Control) As IOrderedDictionary



在双向数据绑定方案中,数据绑定控件将 Control(要从中提取名称/值对)传递至关联的数据源控件。The Control from which to extract name/value pairs, which are passed by the data-bound control to an associated data source control in two-way data-binding scenarios.



名称/值对的 IOrderedDictionaryAn IOrderedDictionary of name/value pairs. 名称表示模板化内容中控件的名称,值是使用双向 ASP.NET 数据绑定语法绑定的属性值的当前值。The name represents the name of a control within templated content, and the value is the current value of a property value bound using two-way ASP.NET data-binding syntax.


ExtractValues(Control)方法必须符合以下规则:An ExtractValues(Control) method must conform to the following rules:

-如果某个给定字段存在多个绑定,则使用遇到的最后一个绑定。- If more than one binding exists for a given field, the last binding encountered is used.

-若要在方法中引用控件的标识符 ExtractValues(Control) ,控件在分析时还必须具有用户定义的 ID 属性。- In order to reference a control's identifier in the ExtractValues(Control) method, the control must also have a user-defined ID property at parse time. 如果不存在任何 ID,将导致分析错误。If no ID exists, this results in a parse error.

-双向 ASP.NET 数据绑定语法只在 ITemplate IBindableTemplate 数据绑定控件的或属性中有效。- Two-way ASP.NET data-binding syntax is only valid in an ITemplate or IBindableTemplate property of a data-bound control.