Solved

Invalid postback or callback argument

Posted on 2008-06-12
16
1,094 Views
Last Modified: 2013-12-17
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.
0
Comment
Question by:gtrapp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
16 Comments
 
LVL 19

Accepted Solution

by:
elimesika earned 200 total points
ID: 21774354
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
 

Author Comment

by:gtrapp
ID: 21780047
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
 

Author Comment

by:gtrapp
ID: 21780294
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
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 
LVL 6

Assisted Solution

by:divyeshhdoshi
divyeshhdoshi earned 50 total points
ID: 21784594
Hi,

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

Regards,
Divyesh Doshi
0
 
LVL 19

Expert Comment

by:elimesika
ID: 21786297
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
 

Author Comment

by:gtrapp
ID: 21794736
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
 
LVL 19

Expert Comment

by:elimesika
ID: 21794830
Yes, it is

can you upgrade ?
0
 
LVL 19

Expert Comment

by:elimesika
ID: 21794860
0
 

Author Comment

by:gtrapp
ID: 21794861
I am looking into it.
0
 
LVL 19

Expert Comment

by:elimesika
ID: 21794882
It says that this is not supported for 1.0 , look for "1.0" in that page
0
 

Author Comment

by:gtrapp
ID: 21795368
I am going to 3.0. Any tips for going from 1.0 to 3.0?
0
 
LVL 19

Expert Comment

by:elimesika
ID: 21795805
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
 

Author Comment

by:gtrapp
ID: 21799675
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
 

Author Comment

by:gtrapp
ID: 21806528
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
 
LVL 19

Expert Comment

by:elimesika
ID: 21810616
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
 

Author Comment

by:gtrapp
ID: 21817756
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

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question