Invalid postback or callback argument error

5. February 2008

Many times ASP.Net users face a problem with invalid Postback or Callback argument error. This error may occur when you are firing click event and the object is rebinding or its properties are changed in Page_Load event. So every time when you are firing event make sure Page_Load event does not change the control.

For example, a problem could be like 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
}


Hope this helps!

 

ASP.NET, Tips n Tricks ,

Comments

2/10/2010 8:10:21 PM #
Thats an exciting send. It was couturier impermanent your blog. Desire to tour again.

Regards

netz

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading