I have a LinkButton in a repeater on my aspx page and I am calling a function oncommand and passing a parameter via CommandArgument but it is giving me compilation error. what am I missing here?? what should I do to fix this problem?
aspx code:
<asp:Repeater id="rptProduct" runat="server">
<HeaderTemplate>
<table border="0" width="100%">
<tr style="background-color:blue">
<th align="center"><asp:Label ID="lblProduct" ForeColor="White" runat="server" Text="PRODUCT CATAGORIES"></asp:Label></th>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:cadetblue">
<td align="center"><asp:LinkButton ID="lbType" ForeColor="White" Font-Underline="false"
OnCommand="LoadGrid" CommandArgument='<%# Eval("ItemTypeNumber") %>'
Font-Bold="true" runat="server" Text='<%# Eval("ItemTypeDescription").ToString() %>'></asp:LinkButton></td>
</tr>
</ItemTemplate>
<%--<SeparatorTemplate>
<tr>
<td colspan="6"><hr></td>
</tr>
</SeparatorTemplate>--%>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
aspx.cs Page:
protected void LoadGrid(int typeno)
{
DataSet ds = new DataSet();
ds = new UsersBLL().GetItemDetails(typeno);
gvDetails.DataSource = ds;
gvDetails.DataBind();
}
Error: Compiler Error Message: CS0123: No overload for 'LoadGrid' matches delegate 'System.Web.UI.WebControls.CommandEventHandler'
It has to match with following method signature.