title: DataList SelectedIndexChange event not firing
body: <p>I have hyperlink and a hidden field inside a datalist as shown below</p>
  
  <pre><code>&lt;asp:DataList ID="clientsList" runat="server" OnSelectedIndexChanged="clientsList_SelectedIndexChanged1" &gt;
     &lt;ItemTemplate&gt;
        &lt;asp:HyperLink ID="hlName" runat="server" Text='&lt;%# Bind("Name") %&gt;' NavigateUrl="#" &gt;&lt;/asp:HyperLink&gt;
        &lt;asp:HiddenField ID="HiddenFieldID" runat="server" Value='&lt;%# Eval("ID") %&gt;' /&gt;                     
     &lt;/ItemTemplate&gt;
  &lt;/asp:DataList&gt;
  </code></pre>
  
  <p>When user clicks on any hyperlink, I need to store that value in an application variable. But the <code>SelectedIndexChange</code> event never fires. </p>
  
  <p>This is my code:</p>
  
  <pre><code>protected void clientsList_SelectedIndexChanged1(object sender, EventArgs e)
  {            
          int idx = clientsList.SelectedIndex;
          HiddenField hiddenCID = clientsList.Items[idx].FindControl("HiddenFieldID") as HiddenField;
  
          if (hiddenCID != null)
          {
              Logger.UpdateLog("Selected ID: " + hiddenCID.Value.ToString());
          }
      }
  </code></pre>
  
  <p>I am binding data from database to the datalist in the <code>Page_load</code> event as below and this is working fine.</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
         BindDataList();
      }           
  }
  </code></pre>
  
  <p>Any idea why this event is never fired?</p>
  
  <p>Also is my code is right as far as accessing the <code>hiddenfield</code> value is concerned?</p>