Home > ASP.NET, Security > ASP.NET Exception – Invalid postback or callback argument

ASP.NET Exception – Invalid postback or callback argument

September 27th, 2009 Kulrom Leave a comment Go to comments

Invalid postback or callback argument

Invalid postback or callback argument

I’ve read many different suggestions for the Invalid postback or callback argument exception but, most of them do not work.
Some people will suggest to add your code inside If Not Page.IsPostBack Then block, other will tell you to set EnableEventValidation to false which is not serious at all. Even the compiler suggests ClientScriptManager.RegisterForEventValidation method but in most of the situations these will not work.

One is for certain: This specific exception is mostly thrown when you use a Master page!!!

Add the same javascript attributes to the very same server control out of the master page and you’ll see that it is working just fine.

Sometimes the solution is that simple that it takes some time to find it :)

Say that you have added some javascript to the button to prevent rapidly and repeatedly clicks before it gets sent to the server.

this.value = 'Please wait...';
this.disabled = true;
.....

The solution is pretty simple. Just set the UseSubmitBehavior property to false.


Voila!

By the way, the UseSubmitBehavior property gets or sets a value indicating whether the Button control uses the client browser’s submit mechanism or the ASP.NET postback mechanism.

Categories: ASP.NET, Security Tags:
  1. Harish
    December 8th, 2009 at 06:32 | #1

    Wow…this is good!! i have been searching this for a long time!!thanks anyways!!
    You Blog site is good!

  1. No trackbacks yet.