DropDownList Issue with Firefox

O

Olivier Verdin

Hi,

I have a page with several Textboxes and several DropDownList. When I click
on a 'save' button, it creates a record in a database.

The page works fine under Internet Explorer.

It does not work under FireFox. The dropdownlist are always selecting the
zero index value. If I debug and I stop the program in the page_load, the
dropdownlist are already set to zero index.

Anyone can help me?

Thanks,

Olivier
 
G

Guest

Olivier, I can't speak to the browser differences, but if you're counting on
the fact that while the first item is shown it's not actually selected yet,
I'd suggest in the interests of usability you either: a) always select your
first item via code if it's the default or b) create a "select one" item as
the first item if there is no good default, and make sure it fails your
validation if the user doesn't change it.

I've always thought it odd there can be an item showing that's not really
selected, and it wouldn't surprise me for that to behave differently on
different browsers.

Bill
 
O

Olivier Verdin

The point is not the usability.

The dropdownlist are selected depending on a value in a record in a
database.

DropDownList show the right value when first displayed. Then the user
changes one of the dropdownlist and click save. The system must take the
new selected value and update the record.

This work fine with IE not with Firefox. That's the issue.

Considerations on usability is not the point to my request. Thanks anyway
for your remark. It will perhaps help someone else.

The question is still open. What is the difference between IE and Firefox
in managing the dropdownlist?

Thanks for your help,

Olivier
 
O

Oleg Ogurok

The selected index is not yet set in Page_Load because ViewState hasn't been
restored/merged; so you can't read it there. You must attach a
SelectedIndexChanged event handler to your drop down list and read the new
value there.

-Oleg.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top