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
3/20/2010 2:04:07 AM #
Great blog, keeping me from working but I enjoyed reading about gridview.
Not many get it right these days.
4/3/2010 7:12:40 AM #
What a awesome  blog!
4/5/2010 4:52:48 PM #
Interesting post Smile Best Regards London Dog Walker
5/10/2010 11:57:04 AM #
gridview I located this excellent write-up whilst exploring thru aol. Especially amazing, when you consider that search rankings tend to present relatively outdated findings and yet this place is genuinely most current! Anyways, wholly illuminating, particularly because this is not really a thing a lot of people typically post a thing decent as regards to. Take care.  Flat to rent Kingston upon thames
5/19/2010 4:59:26 AM #
thank's for you info, i like your post.
Nauman
Nauman
5/26/2010 7:27:48 PM #
i m from pakistan
waoooo great post (y) perfect
6/3/2010 10:33:49 AM #
Can I just say, this blog is what got me through the day today.  Every time I read it, I just get more and more excited about whats next.  Very refreshing blog and very refreshing ideas.  Im glad that I came across this when I did.  I love what youve got to say and the way you say it.
7/21/2010 10:01:45 PM #
Fine information and facts a lot of thanks to the creator
7/31/2010 2:36:23 PM #
intresting post ....thanks for info... wish u best of luck..............................
href="http://www.reviewsa2z.com">website reviews</a>
8/21/2010 1:37:54 PM #
Really found it interesting...Thanks for share good post
Ahmad
Ahmad
8/30/2010 2:41:43 PM #
I found this problem but it was caused by invalid Dropdownlist Validation:
<aspLaughingropDownList ID="ddlTranType" runat="server">
                <asp:ListItem Text="please select" Value="-1"></asp:ListItem>
                <asp:ListItem Text="aaaaa" Value="1"></asp:ListItem>
            </aspLaughingropDownList>
            <asp:RequiredFieldValidator ID="frvddlTranType" ControlToValidate="ddlTranType" InitialValue="-1"
                runat="server" ErrorMessage="*" ValidationGroup="AddMemberTransaction">*</asp:RequiredFieldValidator>


the error come from {Text="aaaaa" Value="1"} when I changed the Value to text value not integer like {Text="aaaaa" Value="AAAAAAA"} , then I redo then everything comeback good

I hope this help.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading