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

  • SEARCH
  • Home
  • 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 814065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:27:41+00:00 2026-05-15T01:27:41+00:00

I have a repeater with a literal, a dropdown list, and a button. <asp:Repeater

  • 0

I have a repeater with a literal, a dropdown list, and a button.

  <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="rep_ItemDataBound" onitemcommand="Repeater1_ItemCommand">
        <ItemTemplate>
          <div class="buypanel">
        <ul>
            <li>Choose finish <asp:DropDownList ID="ddlFinish" runat="server"></asp:DropDownList></li>
            <li>Qty <asp:Literal ID="ltQty" runat="server"></asp:Literal></li>
            <li><asp:Button ID="butBuy" runat="server" Text="Button" /></li>
        </ul>
        </div>
    </ItemTemplate>
    </asp:Repeater>

I am binding all the information in the code behind like

 protected void rep_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Products product = (Products) e.Item.DataItem;


               //Dropdownlist to be bound. 

                //Set Buy Button
                var butBuy = (Button) e.Item.FindControl("butBuy");
                butBuy.CommandName = "Buy";
                butBuy.CommandArgument = product.Id.ToString();

            }
        }

and i have my itemcommand to pick up on the button click

  protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if(e.CommandName == "Buy")
            {

            }
        }

I am not sure how, with a given button click, to pickup the right information from the text box and dropdown list which is along side it?

  • 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-15T01:27:42+00:00Added an answer on May 15, 2026 at 1:27 am

    The RepeaterCommandEventArgs has an “Item” property that you can use to reference the specific item in which the button click occurred (the item that launched the command). Then, you can use the same FindControl method to get the data from the controls.

    Based on the sample code you gave, you can use the CommandArgument property to get the product ID. This, in conjunction with the data gathered from the controls will allow you to create an order.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a repeater like this: <asp:Repeater runat=server ID=pde> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <asp:Literal runat=server ID=literal1></asp:Literal>
I have a repeater: <asp:Repeater ID=rpt_Items OnItemCommand=rpt_Items_ItemCommand runat=server> <ItemTemplate> <div class=item> <div class=fr> <asp:TextBox
i have a repeater than creates a table: <itemtemplate> <tr id=theTableRow runat=server> <td> <asp:LinkButton
I have this repeater: <asp:Repeater ID=rptContentPageGetAll runat=server OnLoad=rptContentPagesGetAll_Load> <HeaderTemplate> <ul class=contentPageTree> </HeaderTemplate> <ItemTemplate> <li><%#
i have a repeater that will output a series of items: <asp:repeater ... runat=Server>
I have a repeater which has a checkBox in the headerTemplate <asp:Repeater ID=myRepeater runat=Server>
I have a Repeater with a Button inside the ItemTemplate . I added the
I have a repeater, in each ItemTemplate of the repeater is an asp:checkbox with
I have a repeater control on an ASP.NET 2.0 web form. As I understanding
I have a .NET repeater control that is data-bound to a List. As part

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.