if a control is disabled, the browser will not post its value back to the
server, so the server can not know the new value.
the viewstate has the value at render (when page was built) and can not be
updated by client script. the viewstate value is compared the postback value
to determine if the value changed.
you can have client script enable the field just before postback (causes an
annoying flash), or have the clients script copy the value to a hidden field
which server code can copy value to dropdown, or if you really clever, the
client script at postback can create new hidden field with the same name as
the disabled control, and copy the value.
-- bruce (sqlwork.com)
"Lars Netzel" <ui****@adf.se> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
Hi
I'm having a DropDown box with 2 items... one with Value 1 and one with
Value 2.
If I load the page and it has Value 1 selected from page_load() and then
select Value 2 on the form.. .and then from a checkbox use javascript to
diasable to DropDownBox before I press a button to do the post back. So..
the DropDownBox has Value 2 but it manually disabled by me..
Then in the FormLoad in the postback.. I read the value.. and it's Value
1,,,how come?
Doesn't the viewstae update the value if the control is disabled?
best regards/
Lars Netzel