Invalid postback or callback argument

61 views
Skip to first unread message

mic

unread,
Nov 7, 2007, 6:07:22 PM11/7/07
to Google AJAX API
I just added the code to my site:

<!-- Google CSE code begins -->
<form id="searchbox_014228868202795174323:qmp1a4gbuou"
onsubmit="return false;">
<input type="text" name="q" size="40"/>
<input type="submit" value="Search"/>
</form>
<script src="http://www.google.com/coop/cse/brand?
form=searchbox_014228868202795174323:qmp1a4gbuou"></script>

<div id="results_014228868202795174323:qmp1a4gbuou"
style="display:none">
<div class="cse-closeResults">
<a>&times; close</a>
</div>
<div class="cse-resultsContainer"></div>
</div>

<style type="text/css">
@import url(http://www.google.com/cse/api/overlay.css);
</style>

<script src="http://www.google.com/uds/api?
file=uds.js&v=1.0&key=XXXXXXXXXX" type="text/javascript"></script>
<script src="http://www.google.com/cse/api/overlay.js"></script>
<script type="text/javascript">
function OnLoad() {
new CSEOverlay("014228868202795174323:qmp1a4gbuou",

document.getElementById("searchbox_014228868202795174323:qmp1a4gbuou"),

document.getElementById("results_014228868202795174323:qmp1a4gbuou"));
}
GSearch.setOnLoadCallback(OnLoad);
</script>
<!-- Google CSE Code ends -->

and got this error:
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.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.

Stack Trace:


[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.]
System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId,
String argument) +2127849
System.Web.UI.Control.ValidateEvent(String uniqueID, String
eventArgument) +106
System.Web.UI.WebControls.TextBox.LoadPostData(String postDataKey,
NameValueCollection postCollection) +31

System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.LoadPostData(String
postDataKey, NameValueCollection postCollection) +11
System.Web.UI.Page.ProcessPostData(NameValueCollection postData,
Boolean fBeforeLoad) +408
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+3776


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832;
ASP.NET Version:2.0.50727.832

jgeerdes [AJAX APIs Guru]

unread,
Nov 8, 2007, 7:02:53 AM11/8/07
to Google AJAX API
The code snippet you posted looks (at least to me) fine. If the
problem was with the JS or API, your page would load; you'd just get
nothing in the area where the search was supposed to go. The error
messages you posted must be associated with your ASP, perhaps in the
way it's processing the <script> tags?

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jgee...@mchsi.com

Reply all
Reply to author
Forward
0 new messages