Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3460742
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:16:00+00:00 2026-05-18T10:16:00+00:00

I have two repeaters that looks like this : Arrange By: Name | Age

  • 0

I have two repeaters that looks like this :

Arrange By: Name | Age | Area

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!

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!

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

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!

Thanks in advance 🙂

EDIT

my.aspx.cs

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();
    }

my.aspx

    <asp:Repeater ID="ArrangeBy_rpt" runat="server">
       <ItemTemplate>
          <asp:LinkButton id="arrange_lnkbtn" OnCommand="arrange_lnkbtn_command" CommandArgument='<%#Eval("arrange_by_id") %>' runat="server">
          <%# Eval("arrange_by") %>
          </asp:LinkButton>
       </ItemTemplate>
       <SeparatorTemplate> | </SeparatorTemplate>
    </asp:Repeater>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

Compilation Error

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?)

Line 4:  <asp:Repeater ID="ArrangeBy_rpt" runat="server">
Line 5:     <ItemTemplate>
Line 6:        <asp:LinkButton id="arrange_lnkbtn" OnCommand="arrange_lnkbtn_command" CommandArgument='<%#Eval("arrange_by_id") %>' runat="server">
Line 7:        <%# Eval("arrange_by") %>
Line 8:        </asp:LinkButton>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:16:01+00:00Added an answer on May 18, 2026 at 10:16 am

    There’s nothing wrong per se with passing data to the same page using the querystring, though it shouldn’t be used for sensitive data that the user might change by “hacking” the URL. However, it’s not the standard way of doing things in ASP.NET WebForms, since it won’t postback the values of any other controls on the page (and hence they won’t retain their state without you manually having to re-populate them on every page load). But if this is not a problem for you, feel free to stick with querystring.

    Howecer, generally you would use a server-side control like an asp:Button or an asp:LinkButton and then handle their OnClick event. However, to pass data with one you can use the CommandName and CommandArgument properties of the button and then handle the OnCommand event.

     <asp:LinkButton id="LinkButton1" 
               Text="Click Me"
               CommandName="Age" 
               CommandArgument="18" 
               OnCommand="LinkButton_Command" 
               runat="server"/>
    

    In code-behind:

      void LinkButton_Command(Object sender, CommandEventArgs e) 
      {
         var data = GetData(e.commandArgument); // implement a method that gets your data filtered by the argument passed from the button
         Repeater2.DataSource = data;
         Repeater2.DataBind();
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two databases. My source looks like this: FirstTable ------ TestingData ----------- Test
I have a table that looks like this: Pizza ----|| Topping ==================== Cheese--|| Olives
I have a pattern that repeats for several member functions that looks like this:
I have a tree-like object structure that consists of two types of objects: object
Half a day spent on this one... On a page, I have two repeaters
I have the same block of code repeated with two different variables. This block
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two application that need to talk to each other. App1 needs to
I have two queries, as following: SELECT SQL_CALC_FOUND_ROWS Id, Name FROM my_table WHERE Name
I have a candidate key (mongodb candidate key, __id) thats looks like the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.