title: DropDownList not firing its SelectedIndexChanged when loaded with no datasource
body: <p>Today I found a weird problem, I was trying to fire a DropDownList SelectedIndexChanged event but it just didn't work at all. After checking with other DropDownLists I have I noticed the only difference is that they are being filled using a datasource while this one is being filled manually in the backend.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>&lt;asp:DropDownList ID="DDDynAccount" runat="server" 
  onselectedindexchanged="DDDynAccount_SelectedIndexChanged" 
  AutoPostBack="true"&gt;&lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>Then the Backcode when loading it:</p>
  
  <pre><code>DDDynAccount.Items.Add(new ListItem("ANY", "%"));
  DDDynAccount.Items.Add(new ListItem("SELECT", "%"));
  </code></pre>
  
  <p>The event which is not being fired:</p>
  
  <pre><code>public void DDDynAccount_SelectedIndexChanged(object sender, EventArgs e) {
      string s = ""; // I have a breackpoint here
  }
  </code></pre>
  
  <p>If I do that, the event is never fired.
  I've tried setting on and off the AutoPostBack. Nothing.
  I've tried making a new control from scratch. Nothing.
  I've also tried to call to Databind() once I've added its items manually but using no Datasource. Again nothing.</p>
  
  <p>I have another DropDownList in the same page that works. The only difference is that that one is using a datasource. So I tried this:</p>
  
  <pre><code>    List&lt;ListItem&gt; ds = new List&lt;ListItem&gt;();
      ds.Add(new ListItem("ANY", "%"));
      ds.Add(new ListItem("SELECT", "%"));
      DDDynAccount.DataSource = ds;
      DDDynAccount.DataBind();
  </code></pre>
  
  <p>And that will work.</p>
  
  <p>My question is simple. <b>WHY?</b> Why cannot I fire the event if Im not using a datasource? Or there is any other problem?</p>
  
  <hr>
  
  <p>I'm using .Net4 with C# in a Web Application.</p>
  
  <hr>
  
  <p><strong>Update</strong>: Ok Im sorry for this but, after checking the code wrotten here I realized a little detail, the Items I was adding manually had the same value, changing it the problem is fixed. I presume the event is not fired because the value hasnt changed, despite the "SelectedIndexChanged" should be fired not when the value is changed, but when the index is.</p>