Click here to Skip to main content
15,886,106 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
system is showing below error while i am clicking on the edit button in the grid view.

__doPostBack('GridView1$ctl02$LinkButton1','')

What I have tried:

ASP.NET
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" OnRowEditing="OnRowEditing">
<columns>
    <asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" />
    <asp:BoundField DataField="Country" HeaderText="Country" ItemStyle-Width="150" />
    <asp:templatefield>
        <itemtemplate>
            <asp:LinkButton ID="LinkButton1" Text="Edit" runat="server" CommandName="Edit" />
        
        <edititemtemplate>
            <asp:LinkButton ID="LinkButton2" Text="Update" runat="server" OnClick="OnUpdate" />
            <asp:LinkButton ID="LinkButton3" Text="Cancel" runat="server" OnClick="OnCancel" />
Posted
Updated 30-Jan-17 1:59am
v2
Comments
Ashwin. Shetty 29-Jan-17 23:26pm    
Please post complete error message
Suvendu Shekhar Giri 30-Jan-17 0:27am    
Not enough information to help you out. Please share the complete error message.

1 solution

1) Invalid Postback or Callback argument in GridView Problem may be: You are binding data in Page_Load event with either Object Data Source or Manual Binding with function call. This will make your GridView bind data on every event fire of any control.

When you are firing any GridView command with OnRowCommand, before RowCommand fire your GridView will rebind and all control within it will be assigned to new id. So RowCommand could not get the item which have fired the event.

Solution for Invalid Postback or Callback argument in GridView: You can bind your data within this if condition

if (!IsPostBack)
{
//Your code for Bind data
}
 
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