Author: brgdotnet | Posted on: 2/18/2010 12:10:37 AM | Views : 1225

I have an Asp.net web form with several drop down list boxes on it. The way the code is currently set up is that the drop down listboxes are populated through use of an ObjectDataSource via a class named SpottedWeb, as referred to by the TypeName attribute.
The problem is that sometimes I need to pre-select drop down list box items, but the ObjectDataSource seems to have the last say in loading the drop down listboxes. So any attempt to pre-select drop down listbox items is undone when my .Aspx code is executed.
My attempt to fix this involved creating an OnPreRender method, because I thought it would have the last say with populating my listboxes. But this is not the case.
So is there a way that I can have the OnPreRender method or some other C# method be called after the .Aspx page
loads my drop downs with the objectDataSource?

// Here is my OnPreRender method.
        protected override void OnPre ...

Go to the complete details ...