formveiw dropdownlist and hiding web controls

S

sandy_carraggi

I have a web form that has a formview on it. Within the edit
template, I have a drop down list and two text boxes along with an
image. The drop down list is bound to a SQL Data Source and the form
view is bound to an Object Data source. What I want to do is when the
user selects/changes the selection in the drop down, depending upon
what gets selected I want to hide the text boxes and the image.

In order to invoke the drop down's
SelectedIndexChanged methed, I'm assuming that I need to set the
AutoPostback property of the drop down list and also set the Enable
View state on both the formview and drop down list. However, when I do
that, each time the page gets posted back, the databound method on the
formview gets triggered and rebinds the dropdown selected value.
Ultimately, I loose the new selection.

I'm hoping I've been clear enough that you understand my dilemma.
What am I doing wrong? Do I need to play games and store the original
value in a session variable and reset the value after the form gets
bound? Or can I intercept the binding and cancel it? Any help would
be much appreciated.

Just in case, all the controls on the Edit Item Template
are binding by: bind("").
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top