title: how to pass values between two repeateres on the same page
body: <p>I have two repeaters that looks like this :</p>
  
  <pre><code>Arrange By: Name | Age | Area
  </code></pre>
  
  <p>what I want to do now is to populate the second repeater from the database with the alphabet, and if the age was clicked then the second repeater gets populated from the database with some age ranges!</p>
  
  <p>I already implemented my idea by placing a hyperlink in the first repeater, that passes -using it's NavigateUrl property- a url for the same page but with some querystring values!</p>
  
  <p>I've been told that querystrings are used for passing values from one page to another, not the same page...and also I wanted to use some AJAX (script manager and update panel) but turns out that I have to use some server control within my repeater instead of html controls so it could be able to post back to the server</p>
  
  <p>I hope you'd help me with a good implementation for passing the value from repeater1 to repeater2 and if you think that I've stated anything wrong Please Corret Me!</p>
  
  <p>Thanks in advance :)</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>my.aspx.cs</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
          {
              string commandString1 = "SELECT [arrange_by_id], [arrange_by] FROM [arrange_by]";
  
  
              using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString))
              {
                  using (SqlCommand cm = new SqlCommand(commandString1, cn))
                  {
                      cn.Open();
  
                      using (SqlDataReader dr = cm.ExecuteReader())
                      {
                          ArrangeBy_rpt.DataSource = dr;
                          ArrangeBy_rpt.DataBind();
                      }
                  }
              }
            }
  
      void arrange_lnkbtn_command(object sender, CommandEventArgs e)
      {
           Label1.Text = (e.CommandArgument).ToString();
      }
  </code></pre>
  
  <p>my.aspx</p>
  
  <pre><code>    &lt;asp:Repeater ID="ArrangeBy_rpt" runat="server"&gt;
         &lt;ItemTemplate&gt;
            &lt;asp:LinkButton id="arrange_lnkbtn" OnCommand="arrange_lnkbtn_command" CommandArgument='&lt;%#Eval("arrange_by_id") %&gt;' runat="server"&gt;
            &lt;%# Eval("arrange_by") %&gt;
            &lt;/asp:LinkButton&gt;
         &lt;/ItemTemplate&gt;
         &lt;SeparatorTemplate&gt; | &lt;/SeparatorTemplate&gt;
      &lt;/asp:Repeater&gt;
  &lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
  </code></pre>
  
  <p>Compilation Error</p>
  
  <p>Compiler Error Message: CS1061: 'ASP.sortingcontrol_ascx' does not contain a definition for 'arrange_lnkbtn_command' and no extension method 'arrange_lnkbtn_command' accepting a first argument of type 'ASP.sortingcontrol_ascx' could be found (are you missing a using directive or an assembly reference?)</p>
  
  <pre><code>Line 4:  &lt;asp:Repeater ID="ArrangeBy_rpt" runat="server"&gt;
  Line 5:     &lt;ItemTemplate&gt;
  Line 6:        &lt;asp:LinkButton id="arrange_lnkbtn" OnCommand="arrange_lnkbtn_command" CommandArgument='&lt;%#Eval("arrange_by_id") %&gt;' runat="server"&gt;
  Line 7:        &lt;%# Eval("arrange_by") %&gt;
  Line 8:        &lt;/asp:LinkButton&gt;
  </code></pre>