C# Developers' Journal (original) (raw)
RepeaterItemEventHandler hello the mighty c# developers! so far so good!
I have Repeater with LinkButton
<asp:linkbutton CommandName="CancelAutorenew" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"[8]") %>'runat="server" ID="CancelAutorenewLinkbutton">
Cancel Autorenew
I want this LinkButton to activate the following function
private void CancelAutorenewLinkbutton_click(object sender, RepeaterCommandEventArgs e)
{
int PurchaseID = Int32.Parse(e.CommandArgument.ToString());
Purchase curPurchase = PaymentManager.GetPurchase(PurchaseID);
}
but I don't know how to register it
I've tried adding to InitializeComponent
this.CancelAutorenewLinkbutton.Command += new System.Web.UI.WebControls.CommandEventHandler(CancelAutorenewLinkbutton_click);
but it doesn't work. I'm getting compilation error. Do you know how to do it?hello the mighty c# developers!