RepeaterItemCollection(ArrayList) 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 RepeaterItemCollection 类的新实例。
public:
RepeaterItemCollection(System::Collections::ArrayList ^ items);
public RepeaterItemCollection (System.Collections.ArrayList items);
new System.Web.UI.WebControls.RepeaterItemCollection : System.Collections.ArrayList -> System.Web.UI.WebControls.RepeaterItemCollection
Public Sub New (items As ArrayList)
参数
示例
void Page_Load(Object Sender, EventArgs e)
{
if (!IsPostBack)
{
ArrayList myDataSource = new ArrayList();
myDataSource.Add(new PositionData("Item 1", "$6.00"));
myDataSource.Add(new PositionData("Item 2", "$7.48"));
myDataSource.Add(new PositionData("Item 3", "$9.96"));
// Initialize the RepeaterItemCollection using the ArrayList as the data source.
RepeaterItemCollection myCollection = new RepeaterItemCollection(myDataSource);
myRepeater.DataSource = myCollection;
myRepeater.DataBind();
}
}
Sub Page_Load(Sender As Object, e As EventArgs)
If Not IsPostBack Then
Dim myDataSource As New ArrayList()
myDataSource.Add(New PositionData("Item 1", "$6.00"))
myDataSource.Add(New PositionData("Item 2", "$7.48"))
myDataSource.Add(New PositionData("Item 3", "$9.96"))
' Initialize the RepeaterItemCollection using the ArrayList as the data source.
Dim myCollection As New RepeaterItemCollection(myDataSource)
myRepeater.DataSource = myCollection
myRepeater.DataBind()
End If
End Sub 'Page_Load
注解
使用此构造函数创建和初始化 类的新实例 RepeaterItemCollection 。