ODS Params from User Control...?

J

JDC

Hi all,

I thought I understood the page lifecycle. but I guess not. I have a
couple of pages with similar GridViews and each is connected to a
ObjectDataSource. Both pages have an identical set of drop-down lists
which define the selection criteria for the grid, and the
SelectParameters of the ODS are bound to these controls.

The set of "selection" drop-down lists seemed like an ideal candidate
to convert into a UserControl. I gave this new control a set of public
string properties which return the selected value of each drop down
list, and placed the user control on each page.

Then I discovered that you can't define a public property of a user
control as the value of a SelectParameter using the ODS parameter
editor. Disappointing.

So in the GridView Selecting event I try to set the parameter values
manually, e.g:
e.InputParameters["limit1"] = myUserControl1.LimitValue;

The user control property looks like this:

public string Limit1Value
{
get { return cboLimit1.SelectedValue; }
}

All the drop-down lists have AutoPostback = false.

The problem is that whatever value I select in the lists, when I click
my "submit" button and step through the GridView Selecting event the
properties of the user control always contain the default (initial)
values of the drop-down lists.

Can anyone kindly tell me what I'm doing wrong?

Cheers, JC
 

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,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top