Sunday, March 11, 2012

Dropdown within ModalPopup

Hi,

Since the new value of the ddl is not yet posted back to the server, in the code behind, the server doesn't know the newly selected value on the client-side.

What you can do is set the AutoPostBack property of the ddl to true. This will make it postback the newly selected value to the server when the index is changed. Ok, normally you would have a full page refresh, but since the dll is on an updatepanel, only the panel gets refreshed.

You should keep in mind that, when the ddl value is changed, and the button in clicked very fast after the ddl-value-change, then on the server-side it is possible that you still work with the old value. That's why you should also do some sort of button disabling when the updatepanel gets refreshed.

Hope this helps!
Wim


Yes, initially I had thought the same, but when the dropdown has autopostback = true, the objectdatasource refreshes and resets the selected item even though enableviewstate = true


Hi,

Can you post the page's code? Possibly stripped so only the problem is shown?

Maybe then we can see what's going wrong.

Regards,
Wim

No comments:

Post a Comment