dropdownlistbox

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
 
N

Nathan Sokalski

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.
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top