473,406 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

ICallbackEventHandler and "Invalid postback or callback argument" error

Hi,

I have an aspx page with two dropdownlist controls.
I update the options in the second ddl based on selection made in the first.

I do this with the ICallbackEventHandler interface, as per "Implementing
Client Callbacks Without Postbacks in ASP.NET Web Pages"
(http://msdn2.microsoft.com/en-us/library/ms178208.aspx)

This works.
However I now want to process the selection subsequently made in the second
ddl, when a button web server control is pressed, caused a normal postback.

When I click the button, I get the 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. "

I believe it is refering to the SelectedIndexChanged event on the second
ddl, which itself does not cause a postback, but should be processed on an
eventual postback (in this case the button.click).

In a nutshell, I'm not clear where to place my call to
RegisterForEventValidation, nor whether/where I should call ValidateEvent.

The example at How to: Implement Callbacks in ASP.NET Web Pages at
http://msdn2.microsoft.com/en-us/lib...18(d=ide).aspx doesn't match
my scenario.

Any help much appreciated.

Thanks
Martin
Jun 14 '06 #1
3 7383
Thinking about this, I think the plan is flawed in having the second ddl
being a server control I expect to process on postback. Primarily because I
don't think there is a model for the options in the dropdownlist changing on
the *client* side. The selected value I want to processs doesn't exist on
the server side.

My plan now is to populate a hidden field when the second ddl changes (all
on the client side), then process the hidden field's ValueChanged event when
I get back to the server.

Comments from those who've been here before??

Thanks again
Martin

"Martin" <x@y.z> wrote in message
news:uj**************@TK2MSFTNGP04.phx.gbl...
Hi,

I have an aspx page with two dropdownlist controls.
I update the options in the second ddl based on selection made in the
first.

I do this with the ICallbackEventHandler interface, as per "Implementing
Client Callbacks Without Postbacks in ASP.NET Web Pages"
(http://msdn2.microsoft.com/en-us/library/ms178208.aspx)

This works.
However I now want to process the selection subsequently made in the
second ddl, when a button web server control is pressed, caused a normal
postback.

When I click the button, I get the 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.
"

I believe it is refering to the SelectedIndexChanged event on the second
ddl, which itself does not cause a postback, but should be processed on an
eventual postback (in this case the button.click).

In a nutshell, I'm not clear where to place my call to
RegisterForEventValidation, nor whether/where I should call ValidateEvent.

The example at How to: Implement Callbacks in ASP.NET Web Pages at
http://msdn2.microsoft.com/en-us/lib...18(d=ide).aspx doesn't
match my scenario.

Any help much appreciated.

Thanks
Martin

Jun 14 '06 #2
Event validation checks that postback data came from a control that was
enabled at render, and if a control with a know list of values, the the
posted value is one of the know values. if you have client script change the
list of values of a dropdown, then you need to disable the default event
validation. as the error message explains, you can either turn it off, or
register you own validation routine for the effected controls.
-- bruce (sqlwork.com)
"Martin" <x@y.z> wrote in message
news:uj**************@TK2MSFTNGP04.phx.gbl...
Hi,

I have an aspx page with two dropdownlist controls.
I update the options in the second ddl based on selection made in the
first.

I do this with the ICallbackEventHandler interface, as per "Implementing
Client Callbacks Without Postbacks in ASP.NET Web Pages"
(http://msdn2.microsoft.com/en-us/library/ms178208.aspx)

This works.
However I now want to process the selection subsequently made in the
second ddl, when a button web server control is pressed, caused a normal
postback.

When I click the button, I get the 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.
"

I believe it is refering to the SelectedIndexChanged event on the second
ddl, which itself does not cause a postback, but should be processed on an
eventual postback (in this case the button.click).

In a nutshell, I'm not clear where to place my call to
RegisterForEventValidation, nor whether/where I should call ValidateEvent.

The example at How to: Implement Callbacks in ASP.NET Web Pages at
http://msdn2.microsoft.com/en-us/lib...18(d=ide).aspx doesn't
match my scenario.

Any help much appreciated.

Thanks
Martin

Jun 14 '06 #3
Thanks Bruce,

I'm working around this at present, but will come back to it at some point.

Martin
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.com> wrote
in message news:e%****************@TK2MSFTNGP05.phx.gbl...
Event validation checks that postback data came from a control that was
enabled at render, and if a control with a know list of values, the the
posted value is one of the know values. if you have client script change
the list of values of a dropdown, then you need to disable the default
event validation. as the error message explains, you can either turn it
off, or register you own validation routine for the effected controls.
-- bruce (sqlwork.com)
"Martin" <x@y.z> wrote in message
news:uj**************@TK2MSFTNGP04.phx.gbl...
Hi,

I have an aspx page with two dropdownlist controls.
I update the options in the second ddl based on selection made in the
first.

I do this with the ICallbackEventHandler interface, as per "Implementing
Client Callbacks Without Postbacks in ASP.NET Web Pages"
(http://msdn2.microsoft.com/en-us/library/ms178208.aspx)

This works.
However I now want to process the selection subsequently made in the
second ddl, when a button web server control is pressed, caused a normal
postback.

When I click the button, I get the 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. "

I believe it is refering to the SelectedIndexChanged event on the second
ddl, which itself does not cause a postback, but should be processed on
an eventual postback (in this case the button.click).

In a nutshell, I'm not clear where to place my call to
RegisterForEventValidation, nor whether/where I should call
ValidateEvent.

The example at How to: Implement Callbacks in ASP.NET Web Pages at
http://msdn2.microsoft.com/en-us/lib...18(d=ide).aspx doesn't
match my scenario.

Any help much appreciated.

Thanks
Martin


Jun 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ron | last post by:
I am trying to run asp.net pages. The server is accessed via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I...
9
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual...
2
by: matsla | last post by:
Hi, I use the ICallbackEventHandler interface, as per "Implementing Client Callbacks Without Postbacks in ASP.NET Web Pages". When i update some dropdown controlls in the callback and then do...
1
by: Java Guy | last post by:
I'm trying to view a web page. IE tells me there are (Java?) errors on the page. Here they are: Line: 15 Char: 7 Error: Wrong number of arguments or invalid propert assignment Code: 0 URL:...
0
by: AparnaKulkarni | last post by:
Hello, I m working with Templates in MS Word. I have established the user Template locations in Word with ".dot" file But after that I m getting error as "Invalid procedure call or argument...
3
by: Don M | last post by:
The code below works fine in IE7 and Firefox2 but gets an "Invalid Argument" error in IE7. I've tried quotes around "ShowContent" ( I've used double " and single ' ) but it doesn't work at all with...
1
by: jjelswick | last post by:
my daughter was sending pics of my grandaughters, i right clicked on them and saved them as a screensaver to look at daily(1st twin grandchildren) now i keep getting invalid argument error and...
4
by: robert | last post by:
On a server the binary (red hat) installed python2.4 and also a fresh compiled python2.5 spits "sem_post: Invalid argument". What is this and how can this solved? Robert ============== ...
9
by: 200dogz | last post by:
Hi guys, I want to have a button which opens up a new window when pressed. <asp:Button ID="Button1" runat="server" Text="Open new window" /> ... Button1.Attributes.Add("OnClick",
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.