Exception message: Invalid postback or callback argument

Posted by Chandhrakv under ASP.NET on 11/18/2009 | Views : 4744 | Status : [Member] | Replies : 7
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 11/18/2009 5:19:13 PM
Event time (UTC): 11/18/2009 11:49:13 AM
Event ID: 9a1dc9c7fbd8412dbff32f1be304c2f6
Event sequence: 49855
Event occurrence: 30
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/915200826/ROOT-1-129029399461539824
Trust level: Full
Application Virtual Path: /
Application Path: C:\AjiraINWarehouse\
Machine name: INCHNCOEAS04

Process information:
Process ID: 3692
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: ArgumentException
Exception message: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Request information:
Request URL: http://www.com/pages/agindcoe/exceedwarehouse/agcwhexceedinbound/agcwhexceedinboundfrpg.aspx?q=cGFnZWlkfEFnQ1dIRXhjZWVkSW5Cb3VuZEZyUGcmYWN0aW9uaWR8T3BlbkFnQ1dIRXhjZWVkSW5Cb3VuZCZhY3Rpb25jcml0ZXJpYXwlNWJBZ0NXSEV4Y2VlZEluQm91bmQlNWQuJTViRm9ybUlkJTVkJTNkJzQzMjIxJyZuZXh0YWN0aW9uY3JpdGVyaWF8JklzUG9wdXBQYWdlfGZhbHNlJnBnY2hpZHxkOTY3MGJmNDlhYTA0MWE2OGNiOWVjYTE3M2VjZDM1ZF9vZXBkenM1NTAwYmdxbjQ1cG5zejN2cnUm-3l7aR6s4N28=&w=;;;;;
Request path: /pages/agindcoe/exceedwarehouse/agcwhexceedinbound/agcwhexceedinboundfrpg.aspx
User host address: 123.252.162.48
User: sh.sawal
Is authenticated: True
Authentication Type: Forms
Thread account name: TPWCKW\Pn.ajira

Thread information:
Thread ID: 12
Thread account name: TPWCKW\Pn.ajira
Is impersonating: False
Stack trace: at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
at System.Web.UI.HtmlControls.HtmlInputHidden.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.HtmlControls.HtmlInputHidden.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


---------------------------------------------------------------


Help required FAST.




Responses

Posted by: Vuyiswamb on: 11/20/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
in your page add this on the first line in the harkup .


EnableEventValidation="false"


and try it again

Thank you for posting at dotnetfunda

Vuyiswa Maseko



Thank you for posting at Dotnetfunda
[Administrator]

Chandhrakv, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chandhrakv on: 11/20/2009 [Member] Starter

Up
0
Down

in your page add this on the first line in the harkup .


EnableEventValidation="false"


and try it again

Thank you for posting at dotnetfunda

Vuyiswa Maseko
-----------------------------------------------------------------------------


Thanks Vuyiswa,

Thanks for your response.

But am not able to figure out this though. Could you please suggest me how to do so. As am new to this am not able to fix it.


Sorry, if created inconvenience.


Thanks,
KVC



Chandhrakv, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/20/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
lets say i have a aspx page and i got your Error , at first it will look like this

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</div>
</form>
</body>
</html>


but to Resolve the issue you need to add it at the top look at the bolded part at the top of the page

<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation ="false" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</div>
</form>
</body>
</html>


Thank you for posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Chandhrakv, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chandhrakv on: 11/20/2009 [Member] Starter

Up
0
Down
Thanks again for the reply..

But in my code we are calling C# code , if i disable this (EnableEventValidation ="false" ) then i wont get any events fired to event log right ?

But i need to fix the solution, but i see we are stepping out of the exception instead resolving.


Could you please let me know, why actually these errors will come up...

Thx,
KVC

Chandhrakv, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/20/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
No No No Event validation has nothing to do with that.

here is a clear reason why its happening

http://odetocode.com/Blogs/scott/archive/2006/03/22/asp-net-event-validation-and-invalid-callback-or-postback-argument-again.aspx


Kind Regards

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Chandhrakv, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chandhrakv on: 11/20/2009 [Member] Starter

Up
0
Down
Thanks Vuyiswa,

For your time and response.

But applying this do we get any page errors in application and will there be any code differences and changes to be done.

Will this effects my application any where ??


Please let me know.


Thanks,
KVC

Chandhrakv, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/20/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
NO this will not affect anything in your code. There only Difference is that you will never have the Error you were getting.

Thank you for posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Chandhrakv, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response