I have a repeater in my webpage which containing Buttons as well..

        <asp:Repeater ID="rptView" runat="server" OnItemDataBound="rptView_ItemDataBound">
                <table border="0" width="90%">
                    <tr class="RepeaterHeader">
                        <th align="center">Date</th>
                        <th align="center">Category</th>
                        <th align="center">Description</th>
                        <th align="center">Amount</th>
                        <th align="center"></th>
                <tr class="RepeaterData">
                    <td align="center"><%#Eval("CurrentDate") %></td>
                    <td align="center"><%#Eval("Category") %></td>
                    <td align="center"><%#Eval("Description") %></td>
                    <td align="center"><%#Eval("Amount", "{0:C}")%></td>
                    <td align="center"><asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button" OnClick="Remove" /></td>

i want detect which row of the Button is exaclty clicked,
then i have to retrieve the value of Category of the Button clicked row due to remove the data.
Any way is able to retrieve data of the repeater from code behind?

how about i want retrieve multiple data?

Cannot Use CommandName and OnCommand Property due to

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Server tags cannot contain <% ... %> constructs.

 <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button" OnComand="Remove" CommandName=<%#Eval("Category") %> />

The Parser Error is Encountered.
But i still have no idea how to retrieve multiple value and how about code behind if using CommandName=<%#Eval("Category")%>?

I am trying to display the Category data and the error i got.

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Code Behind

protected void Remove(object sender, CommandEventArgs e)

Hmm.. I'll research this some more...

Is a gridview control not an option?

A gridview also okay. As long as able to remove particular data from database :)

GridView is solved.

I realise you have probably already moved on from this, but for posterity sake...


you need quotes when specifying server values, which is probably the cause of the parsing error.