I am using a asp.net Drop down list control which is disabled using javascipt, when I am trying to retrieving the value server side the default value is being set on postback.
It is a Web Project and Iam using VS2008.
I am using a asp.net Drop down list control which is disabled using javascipt, when I am trying to retrieving the value server side the default value is being set on postback.
It is a Web Project and Iam using VS2008.
Standard question/answer: Do you databind your Dropdown on every Postback?! If so, check for the IsPostback property of the page in Page.Load.
Disabling a server-side control using javascript can cause the control to not be included when the server decodes the viewstate. You may need to use a HiddenControl to ensure the value is stored.
Alternatively, you could hide the drop down using css, rather than disabling it. Then the value would still exist in the postback. This may not be very good interface design, tho.