Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Repeater.DataBind Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Binds the Repeater control and all its child controls to the specified data source.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

abstract DataBind : unit -> unit  
override DataBind : unit -> unit

Use the DataBind method to bind the data source specified by the DataSource property to the Repeater control. When you bind a data source to the Repeater control, the information in the data source is displayed in the control.

The DataBind method is also commonly used to synchronize the data source and a data listing control after information in the data source is updated. This allows any changes in the data source to also be updated in a data listing control.

If the data source for the Repeater control is specified by the DataSourceID property, you do not need to explicitly call the DataBind method. ASP.NET calls this method automatically to bind the specified data source control to the Repeater control.

The following code example demonstrates how to override the DataBind method in a custom server control so that it always raises a data binding event in a custom Repeater server control.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
© 2015 Microsoft