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

Recommended Answers

All 2 Replies

Hi Raman

Pls. post your code

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,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.