Error: Invalid postback or callback argument

后端 未结 5 1178
無奈伤痛
無奈伤痛 2020-12-18 07:05

I am getting the following error on a button click with gridview

 Server Error in \'/\' Application.
Invalid postback or callback argument.  Event validation         


        
5条回答
  •  春和景丽
    2020-12-18 07:48

    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 
    }
    

    This code will definitely give you solution if this not work then check whether any other control is not giving error.

提交回复
热议问题