T
T.Stanley
Hello.
I have a page containing a radiobuttonlist that is bound to a sqldatasource
providing a "master" list of data keys and descriptors. A second
sqldatasource on the page queries the database for "detail" data, using the
selectedvalue field of the radiobuttonlist as a parameter value. Then I have
formviews that are bound to the output of the second sqldatasource.
This works great and shows the detail data from the key of the FIRST
selection of the radiobuttonlist. It doesn't matter if the selectedvalue is
set by a statement in the Page_Load code, or, if no default selectedvalue has
been initially programmed, at the time that the control is clicked on the
page, causing a selection, autopostback, and FIRST time binding of the detail
sqldatasource.
The problem occurs when I click on the radiobuttonlist control to CHANGE the
selected item from one previously bound. In this case, when the page posts
back, I get an InvalidOperationException error with the descriptor
"Databinding methods such as Eval(), XPath(), and Bind() can only be used in
the context of a databound control."
The problem is clearly in the fact that the detail sqldatasource uses the
selectedvalue of the radiobuttonlist as its query selection parameter,
because if I use a different source for the parameter, this error does not
occur. Of course, then the page does not function as I want it to.
Any ideas would be much appreciated. Thank you.
I have a page containing a radiobuttonlist that is bound to a sqldatasource
providing a "master" list of data keys and descriptors. A second
sqldatasource on the page queries the database for "detail" data, using the
selectedvalue field of the radiobuttonlist as a parameter value. Then I have
formviews that are bound to the output of the second sqldatasource.
This works great and shows the detail data from the key of the FIRST
selection of the radiobuttonlist. It doesn't matter if the selectedvalue is
set by a statement in the Page_Load code, or, if no default selectedvalue has
been initially programmed, at the time that the control is clicked on the
page, causing a selection, autopostback, and FIRST time binding of the detail
sqldatasource.
The problem occurs when I click on the radiobuttonlist control to CHANGE the
selected item from one previously bound. In this case, when the page posts
back, I get an InvalidOperationException error with the descriptor
"Databinding methods such as Eval(), XPath(), and Bind() can only be used in
the context of a databound control."
The problem is clearly in the fact that the detail sqldatasource uses the
selectedvalue of the radiobuttonlist as its query selection parameter,
because if I use a different source for the parameter, this error does not
occur. Of course, then the page does not function as I want it to.
Any ideas would be much appreciated. Thank you.