Need help with postback/callback argument error!
Need help with postback/callback argument error!
Need help with postback/callback argument error!
Need help with postback/callback argument error!
Need help with postback/callback argument error!
Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error!
Need help with postback/callback argument error! Need help with postback/callback argument error!
Need help with postback/callback argument error!
Go Back  Xtreme Visual Basic Talk > > > Need help with postback/callback argument error!


Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2006, 04:02 AM
VBISCOOL2 VBISCOOL2 is offline
Regular
 
Join Date: Sep 2006
Posts: 51
Angry Need help with postback/callback argument error!


Hello.

I have a webform with a button and a text box. I am also using a codebehind file. When the user presses the button a connection to the database is made and a stored procedure is executed and the number of rows affected is returned.

This is my @Page:

HTML Code:
<%@ Page  EnableSessionState="false" EnableEventValidation="true" EnableViewState="false" Language="VB" CodeFile="index.aspx.vb" Inherits="IndexPg" %>
However, I am getting the following error when I press the button at runtime:

==========================================================

Server Error in '/WebSite2' Application.
--------------------------------------------------------------------------

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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: 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.


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

Thanks for any help!
Reply With Quote
  #2  
Old 09-20-2006, 08:18 AM
wayneph's Avatar
waynephNeed help with postback/callback argument error! wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Does it work if you change EnableEventValidation to False? I've never personally used this feature, so we may have to take a few steps to figure this out.

Also, Are you using the ClientScriptManager.RegisterForEventValidation() anywhere in your code?

I'm assuming this is .NET 2.0?
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #3  
Old 09-20-2006, 09:15 AM
VBISCOOL2 VBISCOOL2 is offline
Regular
 
Join Date: Sep 2006
Posts: 51
Default

Quote:
Originally Posted by wayneph
Does it work if you change EnableEventValidation to False?
I'm assuming this is .NET 2.0?



Wow! That worked. I'm using 2005. Well that was pretty simple I guess.

Cheers!
Reply With Quote
  #4  
Old 09-20-2006, 11:54 AM
wayneph's Avatar
waynephNeed help with postback/callback argument error! wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

You turned on one of the security checks, and then violated it. By setting it to false, you're potentially opening yourself up to attacks. I'd take a look at the other function mentioned as well, to tighten up security.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #5  
Old 09-22-2006, 04:15 AM
VBISCOOL2 VBISCOOL2 is offline
Regular
 
Join Date: Sep 2006
Posts: 51
Default

I see your point Wayneph but I'm not quite sure how to use the ClientScriptManager.RegisterForEventValidation () function.

Fortunately this page will only be used/accessible to about 5 people who I work with so security won't be too much of an issue.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Need help with postback/callback argument error!
Need help with postback/callback argument error!
Need help with postback/callback argument error! Need help with postback/callback argument error!
Need help with postback/callback argument error!
Need help with postback/callback argument error!
Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error! Need help with postback/callback argument error!
Need help with postback/callback argument error!
Need help with postback/callback argument error!
 
Need help with postback/callback argument error!
Need help with postback/callback argument error!
 
-->