title: Dynamically added LinkButton CommandName/CommandArgument settings being dropped
body: <p>I am attempting to implement a pagination bar above a table. I have a static <code>&lt;ul&gt;</code> element on my page:</p>
  
  <pre><code>&lt;div&gt;&lt;center&gt;&lt;ul id="topnav" runat="server"&gt;&lt;/ul&gt;&lt;/center&gt;&lt;/div&gt;
  </code></pre>
  
  <p>In my Page_Load event, I attempt to load it with page numbers:</p>
  
  <pre><code>foreach ( int linkpage in linkpages ) {
    HtmlGenericControl li;
    LinkButton pbut;
    li = new HtmlGenericControl( "li" );
    pbut = new LinkButton();
    pbut.CommandName = "page";
    pbut.CommandArgument = linkpage.ToString();
    pbut.Text = linkpage.ToString();
    li.Controls.Add( pbut );
    topnav.Controls.Add( li );
  }
  </code></pre>
  
  <p>However, when the control is actually rendered it posts as name 'ctlXX' (where XX is an incrementing number) and no argument, so I am unable to get the page number. The .Text attribute renders fine, however. What am I doing wrong? Is this entirely the wrong approach?</p>