Invalid postback or callback argument

I receive this error on a page with a button, and only a button and text. I have seen some articles on the internet, but don't really see a good answer. Security is important for my Internet app. This page works fine when I am not autenicated. The web application has a login page, where users login and get authenicated. When I users are authenicated and then access this page, the error occurs. Any suggestions?

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.
gtrappAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
elimesikaConnect With a Mentor Commented:
HI

The error you have got is very descriptive , you have to add a property to your page (see code)

see

http://msdn.microsoft.com/en-us/library/system.web.configuration.pagessection.enableeventvalidation.aspx
 <%@ Page EnableEventValidation="true" %>

Open in new window

0
 
gtrappAuthor Commented:
Yes, I was thinking about your solution before I asked the question, but what about security issues? Are there any problems with setting this in regards to security?
0
 
gtrappAuthor Commented:
I get the following error message:

The 'EnableEventValidation' attribute is not supported by the 'page' directive.

When adding EnableEventValidation="false". My page directives look like this:

<%@Page language="c#" Codebehind="RequestLoginHelp.aspx.cs" AutoEventWireup="false" EnableEventValidation="false" Inherits="pbFamily.RequestLoginHelp" %>

Any suggestions?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
divyeshhdoshiConnect With a Mentor Commented:
Hi,

set EnableEventValidation="true" in <%@ Page />
like
<%@ Page EnableEventValidation="true" %>

Regards,
Divyesh Doshi
0
 
elimesikaCommented:
HI

The following is taken from MS help , I suggest that you set this flag to true , try to set it in page_init as described below or in your config file

The event validation mechanism reduces the risk of unauthorized postback requests and callbacks. When the EnableEventValidation property is set to true, ASP.NET allows only the events that can be raised by the control during a postback request or callback.
[Note] Note:

This event validation mechanism reduces the risk of unauthorized postback requests and callbacks. With this model, a control registers its events during rendering and then validates the events during the post-back or callback handling. All event-driven controls in ASP.NET use this feature by default.

It is strongly recommended that you do not disable event validation. If you do disable event validation, make sure that no postback could be constructed that could have an unintended effect on your application.

In most circumstances, you set the EnableEventValidation property by setting the enabledEventValidation attribute of the @ Page directive or the enableEventValidation attribute of the pages element in the Web.config file. If you set the EnableEventValidation property in code, set it in the Page_Init phase of page processing.
0
 
gtrappAuthor Commented:
I think my problem is that I have .Net 1.0 installed. I don't have 2.0.

Line 14:       </appSettings>
Line 15:       <system.web>
Line 16:             <pages enableEventValidation="false"/>
Line 17:             <!--  DYNAMIC DEBUG COMPILATION
Line 18:           Set compilation debug="true" to enable ASPX debugging.  Otherwise, setting
0
 
elimesikaCommented:
Yes, it is

can you upgrade ?
0
 
gtrappAuthor Commented:
I am looking into it.
0
 
elimesikaCommented:
It says that this is not supported for 1.0 , look for "1.0" in that page
0
 
gtrappAuthor Commented:
I am going to 3.0. Any tips for going from 1.0 to 3.0?
0
 
elimesikaCommented:
Yes, follow this http://blogs.msdn.com/pandrew/archive/2007/10/25/how-to-upgrade-from-net-framework-1-0-to-net-framework-3-5.aspx

and you are done

It covers migration 1.0 to 1.1. to 2.0 to 3.0 and to 3.5

GOOD LUCK
0
 
gtrappAuthor Commented:
Something interesting:

My test environment is .Net 1.1. The production environment is 2.0.5. In the production environemnt I have set enableEventValidation="true" on the page. The Invalid postback or callback argument still occurs. I have also tried setting this in the web.config file but the error occurs.
0
 
gtrappAuthor Commented:
On the web server with .NET 2.0, and in the web.config file I set enableEventValidation="false". The page comes up successfully with no errors with this setting. Setting it to true caused the error. Do you know why this is?
0
 
elimesikaCommented:
HI

see below , is there a chance that your validation occurs before the page is rendered ?

Check this threads:

http://www.velocityreviews.com/forums/t122207-aspnet-20-bug.html
http://forums.asp.net/rss.aspx?ForumID=180&PostID=1715539
0
 
gtrappAuthor Commented:
It turns out that I need to stick with .Net 1.1. If I set the site to use ASP .Net 1.1, then this error goes away.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.