<%# Field(((DataRowView)(Container.DataItem)), "Title")%> --
<%# Field(((DataRowView)(Container.DataItem)), "Date")%>
The pre-generated Code Behind is going to look like the following:
Code Behind
using System;
using System.Collections;
using System.Web.UI.WebControls;
protected Repeater container;
protected void LoadContainer(Object sender, EventArgs e)
{
container.DataSource = Data;
}
override public void InitUserHandlers(EventArgs e)
{
LoadContainer(this,e);
}
protected void OnItemDataBound(Object sender, RepeaterItemEventArgs e)
{
}
protected void OnItemCreated(Object sender, RepeaterItemEventArgs e)
{
// if((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
// {
// ****please use if needed
// }
}
The DataTable instance generated during the data retrieval process is available via Data property of Publishing Container.
There are also unimplemented Repeater event handlers: OnItemDataBound и OnItemCreated.
NOTE: There is no need to declare controls in Code Behind if you’re using “Assemble Using Partial Classes” option (set at “Site Properties”)
IMPORTANT: In order to use nested Publishing Container objects (one object calling another) or pass information between objects ItemCreated or ItemDataBound should be used. To add a nested object in Presentation for every retrieved record inside