views:

17

answers:

0

I load a usercontrol dynamically to a page on click of a button. This user control has dropdown list which gets populated on load of the user control. When I select an item from this dropdown list a post back occurs and I reload the Usercontrol again at oninit of the page. The dropdown list is not populated and hence the selection index changed event is not fired. I have tried rebinding the dropdown again, but the selection is lost. When page is displayed again with the dropdown starts remembering its viewstate since the usercontrol was loaded at OnInit event.

In theory when the usercontrol was loaded on button click it is supposed to track its viewstate. Why doesnt it track the dropdown list change(databinding) the first time? Is there any trick by which I can make the dropdown track it right from the first databind?