Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 19th, 2008, 06:23 AM
Authorized User
 
Join Date: Feb 2008
Location: Bangalore, A.P, India.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invalid postback or callback argument

hi friends,

i am using gridview with template field buttons and at runtime when i click the button I am getting an error as follows

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.


AMR
  #2 (permalink)  
Old February 19th, 2008, 09:46 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This usually happens when that data that is being posted could be harmful. An example would be a textbox in which you enter HTML. Because HTML can contain javascript tags which could be harmful, ASP.NET will, by default, throw the exception you are seeing because it fails post validation. If you do as the error message suggests and set EnableEventValidation to false, this problem should go away. However, be aware that you are opening up the possibility of malicious data entry.

-Peter
peterlanoie.blog
  #3 (permalink)  
Old February 19th, 2008, 05:58 PM
Authorized User
 
Join Date: Nov 2003
Location: Hollywood, Fl, USA.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sonicDace Send a message via MSN to sonicDace Send a message via Yahoo to sonicDace
Default

Actually, this happens when the source that triggered the event was not the gridview. I.E, you have some JavaScript on your page that calls the click() event on some link in your gridview, which in turn causes it to post back.

The "EnableEventValidation='true'" detects this as a security issue and blocks the event. If you want to allow your client-side code to interact with your gridview, set this to false

thanks
  #4 (permalink)  
Old February 20th, 2008, 03:15 AM
Authorized User
 
Join Date: Feb 2008
Location: Bangalore, A.P, India.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

:)Thank you guys and my problem is solved

AMR
  #5 (permalink)  
Old February 20th, 2008, 07:38 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

sonicDace - Thanks for the correction. I think I need a vacation.

-Peter
peterlanoie.blog
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Invalid postback or call back argument kalyanykk ASP.NET 2.0 Basics 0 August 26th, 2008 06:03 AM
Invalid Argument ppenn Access VBA 2 May 14th, 2007 10:11 AM
Invalid postback or callback argument everest ASP.NET 2.0 Professional 2 January 9th, 2007 07:28 AM
Invalid postback or callback argument. kingw BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 January 1st, 2007 08:49 PM
Invalid Argument.... baNTON Access VBA 4 April 27th, 2004 06:18 AM



All times are GMT -4. The time now is 07:40 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.