DropDownList reset itself

C

Cal Who

I have a DropDownList.
When I click on an item in the dropped down box I see that item for an
instance in the text box and then the text changes so that item 2 is always
selected.

I don't believe it is not my code-behind because I've commented most of it
out and have a break point in the load event that initializes the box.

I have autopostback set to true and know it does post back.

That is probably where the change takes place but I don't know how to stop
the change or even why it is changing.

I'm guessing that the view state refers to the state of the box before the
click occured.

Got any suggestions?


Thanks
 
A

Andrew Morton

Mark said:
Sounds like you're populating the DropDownList in the Page_Load
event. If so, try moving the code which does the populating into the
Page_Init event.

Either that or check if the page is a postback:

sub page_load(...) handles ....
if not(page.ispostback) then
' initialize dropdown(s)
end if
end sub

Andrew
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top