Note that there are some explanatory texts on larger screens.

plurals
  1. POSelected Index doesn't change
    primarykey
    data
    text
    <p>I have an ASP.NET DropDownList control, with a onSelectedIndexChanged event. I also have the AutoPostBack="true" that many have said would fix the problem. However I don't think that is where the problem lays... My Html code and C# code are below for reference. The thing is the code works, but only when I press the enter key while editing the drop down box. If I simply click on an object in the drop down then the event will not fire. If I change the selected item so the "selected" text in the drop down says "ASP" and I then inspect the element using the browser I see that the Selected="True" part of the ListItem is still on the first item... It doesn't change in there. It changes with an enter key but not with a mouse click. Any help is welcome and much appreciated.</p> <p>HTML:</p> <pre><code>&lt;div class="ui-widget"&gt; &lt;asp:DropDownList id="Select1" OnSelectedIndexChanged="Select1_SomethingChange" runat="server" AutoPostBack="true"&gt; &lt;asp:ListItem Selected="True" Value="White"&gt; White &lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Select one..."&gt;Select one...&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="ActionScript"&gt;ActionScript&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="AppleScript"&gt;AppleScript&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Asp"&gt;Asp&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="BASIC"&gt;BASIC&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;/div&gt; </code></pre> <p>C#:</p> <pre><code>protected void Select1_SomethingChange(object sender, EventArgs e) { //something is meant to happen here } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload