BUG DropDownList ?

Discussion in 'ASP .Net Web Controls' started by Mario Hébert, Nov 27, 2003.

  1. I had some strange behaviors when i were using the .Net DropDownList. Here's
    my control declaration in the aspx page:

    <asp:dropdownlist ID="cboModulePriority" runat="server" Width="200">
    <asp:ListItem Value="200" Selected="True">Default(200)<asp:ListItem/>
    <asp:ListItem Value="400">Custom Generic(400)<asp:ListItem/>
    <asp:ListItem Value="600">Generic(600)<asp:ListItem/>
    </asp:dropdownlist>

    Like shown, the 1st ListItem is marked as selected. If i am in a form, that
    i reload from a subsequent call(the page already knows the default values
    entered by the user, stored in a DB for example), and in the compiled code i
    set the cboModulePriority.SelectedItem or SelectedValue to another index
    than the fisrt one(suppose that the user has posted the form before with a
    value of 600), when i look to the HTML rendering result, the <Option> tag of
    the 1st ListItem is broken... Also, we don't see the select end tag...

    <div>
    <select name="cboModulePriority" id="cboModulePriority"
    style="width:200px;">
    <option value="200">Default(200)</option>
    <option selected="selected" value="400">Custom Generic(400)</option>
    <option </div>...

    With this bug, i understood that is better to not set the Selected property
    in the aspx page if you will adjust the selected item in the compiled
    code....


    Mario
     
    Mario Hébert, Nov 27, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,676
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,272
    tshad
    Oct 19, 2005
  3. =?Utf-8?B?SnVhbmpv?=

    GridView: Filtr DropDownList from another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,899
    =?Utf-8?B?SnVhbmpv?=
    Dec 23, 2005
  4. =?Utf-8?B?SnVhbmpv?=

    GridView: Filter DropDownList for another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,338
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. keithb
    Replies:
    1
    Views:
    12,174
    shauns1
    Nov 1, 2006
Loading...

Share This Page