Jibu P C_Adoor
Jibu P C_Adoor

Reputation: 3364

How to implement Datasource property on custom controls?

Hii,

I m working in Asp.net 2.0 with C#.... I have a custom control and i have to use 'Datasource' property which is exactly like a repeater having. Any idea regarding this pls help me.

Upvotes: 0

Views: 502

Answers (1)

Mantorok
Mantorok

Reputation: 5276

Any public property with a setter will be exposed in the markup:

public class MyControl : UserControl
{
   public object DataSource {get; set;}
}

This will allow you to set the DataSource property either through the HTML or in code.

Is that what you meant?

Upvotes: 1

Related Questions