0

i am having a peculiar prob with drop down list

whenever i am trying to open my form,the drop down list is not getting populated for the first time...but the second time the drop down is getting populated

hav a grtt day

thanx in advance

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by greyhound
0

Without code it is tricky but I think this may be a postback/page life cycle issue.

Is your drop down list created dynamically (ie. in code or instantiating from a user control)

If the answer to the above is yes then you will need to move your code into the page_init section rather than the page_load. This will have the effect of binding your control (presumably databound in some fashion) at the right stage in the life cycle thus displaying correctly on the first page load.

You will need to check for a postback though otherwise the dropdownlist may keep databinding on subsequent page views.

ie.

if(!Page.IsPostBack) { bindmycontrolstuff() ;}

Post your code if you need further information.

Regards,

Edited by greyhound: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.