dropdownlistbox

  • Thread starter Thread starter sharath
  • Start date Start date
S

sharath

sir,

when i bind the dropdownlistbox through dataset, ok fine iget the datas.
i have one command button and one label

i want to display the selected item in label when i click button.

but my problem is: when i select the item from dropdownlist box and press commanbutton it automatically give the first selected item text but not the selected item which i had selected.

sir please help me

give the code



From http://www.developmentnow.com/g/8_2004_6_0_29_0/dotnet-framework-aspnet.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
I would make sure ViewState is enabled for the DropDownList. If you have
EnableViewState="False" for either the DropDownList or in the @Page
directive, it will reset it to the first item. We may be able to help more
if we saw your code.
 
you are probably binding in form onload. this overwrites the postback
value. if you are using viewstate , only bid is not a postback, if
viewstate is off (a good idea), databind in oninit.

-- bruce (sqlwork.com)
 
Back
Top