ASP.NET Repeater User Control DataSource?

You should do such things in the DataBind() method like shown below.

You should do such things in the DataBind() method like shown below: public override void DataBind() { this.repeater. DataSource = ... this.repeater.DataBind(); ... } So it will bind whilst parent page calling Page.DataBind() as well Control. DataBind Method: Use this method to bind data from a source to a server control.

This method is commonly used after retrieving a dataset through a database query. Most controls perform data binding automatically, which means that you typically do not need to call this method explicitly.

The error still occurs even though the data source contains items. The override method doesn't seem to be being called. – aspdotnetuser Sep 29 at 12:36 I don't understand how it can display this error when the datasource is being set with an object that contains data?

– aspdotnetuser Sep 29 at 12:42 @aspdotnetuser : are you sure that problem is with repeater? Can you enable CLR exceptions in the Debug -> Exceptions VS Menu and run in debug mode (or attach debugger to w3wp. Exe process) and see pwerhaps the problem in an other place – sll Sep 29 at 13:02.

Try this: Inside the user controls where is the repeater located, in the OnLoad() method do this : repeater1. DataSource = MyIEnumerableProperty; repeater1.DataBind().

I tried that but it errors on the line where the DataSource is set. – aspdotnetuser Sep 29 at 12:25.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions