title: C# asp.net why does my manual __doPostBack only run once?
body: <p>In my code I create the menu items dynamically:</p>
  
  <pre><code>string listClientID = BulletedList1.ClientID.Replace('_', '$');
  int counter = 0;
  
  foreach (DataRow dataRow in database.DataTable.Rows)
  {
      // Add Button
      ListItem listItem = new ListItem();
      listItem.Value = "buttonItem" + Convert.ToString(dataRow["rank"]);
      listItem.Text = " " + Convert.ToString(dataRow["title"]);
      listItem.Attributes.Add("onclick", "__doPostBack('" + listClientID + "', '"+ counter.ToString() +"')");
  
      BulletedList1.Items.Add(listItem);
  
      counter++;
  
  }
  </code></pre>
  
  <p>This menu is inside a update panel:</p>
  
  <pre><code>&lt;div id="MenuItemBox"&gt;
      &lt;asp:BulletedList 
          ID="BulletedList1" 
          runat="server"
          OnClick="MenuItem_Click"
          &gt;
      &lt;/asp:BulletedList&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What I want is when a listitem is clicked it performs a postback. But when I run this, the onclick event is only runned once. </p>
  
  <p>For example. I have 4 listitems. When I click the first item the first time the onclick event is executed. Now I click the second item, the onclick event is also executed. But when I now click the first item again the onclick event is not fired.</p>
  
  <p>When I check the error console in FireFox or Oprah I don't get any errors.</p>
  
  <p>So my question is: how can I fix this and what am I doing wrong?</p>