ASP.NET 2.0: ObjectDatasSource and Web UserControls...

C

Christian Petersen

Hi,
I've got a WebForm with a GridView, I want to databind this to an
ObjectDataSource (ODS1).
The input parameters for the ODS1 is placed on a Web UserControl, in the
form of public properties that accesses databound DropDownLists. Like this:
<asp:ControlParameter ControlID="WUC1" DefaultValue="0" Name="Id"
PropertyName="SelectedId" Type="Int32" />

The DropDownLists are databound with ObjectDataSources also.

But the GridView on the WebForm is databound before the UserControl, so I'm
getting a FormatException, because the DropDownLists are empty.

Is there a best practice pattern for this if you want to use
ObjectDataSources?

In the olden days (ASP.NET 1.1) I usually databound the DataGrid in the
prerender event, after the UserControls were loaded.

Mvh,
Christian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top