Click here to Skip to main content
15,900,108 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a little asp.net application. I want to use the Product_Id to fetch the remaining data from data and display it on a new page when my link button is clicked. i am currently been able to fetch bind my repeater with records but the little challenge i'm having is that i can't get a way round how i would be able to fetch the remanining records from database to a new page when a particular product name is clicked. Kindly give an head start guys!.

What I have tried:

ASP.NET
<div>  
  <asp:Repeater ID="rptResult" runat="server" OnPreRender="rptResult_PreRender" OnItemDataBound="rptResult_ItemDataBound">
    <headertemplate>
      <itemtemplate>                  
        <div>
          <div class="product-text">
            <div class="prodcut-name">
                <a>"><asp:LinkButton ID="ProductName" runat="server" CommandArgument='<%#Eval("Product_Id") %>' Text='<%#Eval("Product_Name") %>' OnClick="ProductName_Click"/> <
                    <div class="prodcut-ratting-price">
                        <div class="prodcut-price">
                            <div class="new-price"> 
                                <asp:Label ID="ProductPrice" runat="server" Text='<%#Eval("Product_Price") %>'/>
                            </div         
      
                    
</div></div></div></a></div></div></div></div>
Posted
Updated 30-Mar-17 13:42pm
v7

1 solution

1. On ProductName_Click method find the button ID by findcontrol method.
EX:
protected void ProductName_Click(object sender, EventArgs e) {

var btn = (Button)sender;
var item = (RepeaterItem)btn.NamingContainer;
var ddl = (DropDownList) item.FindControl("ddlWorkflowMembers");

var ProductID=ddl.CommandArgument;
//Here you can find the productid of that button which u have assigned.
}

Check this code it may help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900