I am working with a combo box whose contents are taken from DB to populate the db. I have given in the load event to fill the combon box when page is not postbacked.
But still each time the page postbacks the combobox is getting filled and so when i select a item in combo box and postback is done i always getting the first value in the combo box.
i have set the enableviewstate of combo box as true
Can any one tell me how to hold value in the combobox
Regards
Thanks in advance
hari
Loading

PHANI NADIGADDAPosted Jan 30, 2007, 12:22 PM
Your list will populates with the data each time when the page is postback, and selected index will be 0.
Write the following code in your page_load event.
if(!Page.IsPostback)
{
populate your list
}
this code executes only once and when your page is postback and this will not execute and you will have the item what you select.
ALL THE BEST.