Meps
asked on
Button Onclick event within a Repeater?
I think this is pretty easy, but I just can't seem to get it to work.
What I want to do is have the onclick fire off the function that I created for it.
What I want to do is have the onclick fire off the function that I created for it.
------------------ASP.Net Page------------------------------
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:Button ID="btnProduct" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Products")%>' OnClick='SelectProduct(<%# DataBinder.Eval(Container.DataItem, "ProductID")%>)' />
</ItemTemplate>
</asp:Repeater>
------------------------Code--------------------------------
protected void SelectProduct(int ProductID)
{
AnswerMainDTO AuditAnswer = (AnswerMainDTO)Session["AuditAnswer"];
AuditAnswer.Product = ProductID;
Session["AuditAnswer"] = AuditAnswer;
Response.Redirect("~/AuditMain.aspx");
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER