B
bill
I have a Repeater control in a web user control.
The web user control has a public method named PopulateRepeater which takes
an ID as an parameter and populates the repeater control based on the
parameter.
When I call PopulateRepeater from the User Control page_load event it
populates the repeater without a problem.
When I call PopulateRepeater from a procedure in the web form which contains
the user control, I get an error in PopulateReader (which is in the User
Control code behind module):
Sub PopulateRepeater (iID as integer)
dim ds as DataSet = GetDataSet(iID)
Repeater1.DataSource = ds ' causes error "Object reference not set
to an instance of an object"
Repeater1.DataBind
Exit Sub
The web user control has a public method named PopulateRepeater which takes
an ID as an parameter and populates the repeater control based on the
parameter.
When I call PopulateRepeater from the User Control page_load event it
populates the repeater without a problem.
When I call PopulateRepeater from a procedure in the web form which contains
the user control, I get an error in PopulateReader (which is in the User
Control code behind module):
Sub PopulateRepeater (iID as integer)
dim ds as DataSet = GetDataSet(iID)
Repeater1.DataSource = ds ' causes error "Object reference not set
to an instance of an object"
Repeater1.DataBind
Exit Sub