By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,773 Members | 1,779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,773 IT Pros & Developers. It's quick & easy.

postback problem

P: n/a
Hi all,

I have a bunch of dropdownlists that are populated in client-side
javascript. When i do a postback I get the following 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.

Any Ideas? What can I do to fix it?

TIA!
Nov 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
TIA,

as the error message indicates asp.net >= 1.1 in the default configuration
hinders changes made on the client to prevent XSS (Cross Site Scripting). If
you don't want this support you can change <pages
enableEventValidation="true"/> to <pages enableEventValidation="false"/> or
set <%@ Page EnableEventValidation="true" %> to <%@ Page
EnableEventValidation="false" %> in the one page you want to allow changes
made to your dropdownlists. Be sure though to check EVERY value on the
server. Remember: ALL INPUT IS EVIL!!!

Regards

Daniel Walzenbach

<pa***@community.nospam> schrieb im Newsbeitrag
news:eV**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I have a bunch of dropdownlists that are populated in client-side
javascript. When i do a postback I get the following 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.

Any Ideas? What can I do to fix it?

TIA!

Nov 19 '05 #2

P: n/a
Hi Param,

I think Daniel's suggestion is correct. The "EnableEventValidation" (by
default turn on ) in asp.net 2.0 is used to ensure that all the postback
request of the page is caused by the servercontrol or script code rendered
by the page's serverside code. So when you populate some clientside html
elemetns and postback through them, it will violate the event validation...

You can either turn off this feature at Page Level through the @Page
directive or in the web.config 's <pages> setting .... (for the whole web
application).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Daniel Walzenbach" <da***************@newsgroup.nospam>
| References: <eV**************@TK2MSFTNGP09.phx.gbl>
| Subject: Re: postback problem
| Date: Mon, 14 Nov 2005 02:14:21 +0100
| Lines: 47
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Response
| Message-ID: <uz**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: p54AC0C93.dip0.t-ipconnect.de 84.172.12.147
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:357799
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| TIA,
|
|
|
| as the error message indicates asp.net >= 1.1 in the default
configuration
| hinders changes made on the client to prevent XSS (Cross Site Scripting).
If
| you don't want this support you can change <pages
| enableEventValidation="true"/> to <pages enableEventValidation="false"/>
or
| set <%@ Page EnableEventValidation="true" %> to <%@ Page
| EnableEventValidation="false" %> in the one page you want to allow
changes
| made to your dropdownlists. Be sure though to check EVERY value on the
| server. Remember: ALL INPUT IS EVIL!!!
|
|
|
| Regards
|
|
|
| Daniel Walzenbach
|
|
|
|
|
| <pa***@community.nospam> schrieb im Newsbeitrag
| news:eV**************@TK2MSFTNGP09.phx.gbl...
| > Hi all,
| >
| > I have a bunch of dropdownlists that are populated in client-side
| > javascript. When i do a postback I get the following 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.
| >
| > Any Ideas? What can I do to fix it?
| >
| > TIA!
| >
|
|
|

Nov 19 '05 #3

P: n/a
Hi Param,

Does turn off the EnableEventValidation resolve yorur problem? If there're
anything else need assistance, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 148248228
| References: <eV**************@TK2MSFTNGP09.phx.gbl>
<uz**************@TK2MSFTNGP10.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online.microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Mon, 14 Nov 2005 08:57:48 GMT
| Subject: Re: postback problem
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <53**************@TK2MSFTNGXA02.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 79
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:357853
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Param,
|
| I think Daniel's suggestion is correct. The "EnableEventValidation" (by
| default turn on ) in asp.net 2.0 is used to ensure that all the postback
| request of the page is caused by the servercontrol or script code
rendered
| by the page's serverside code. So when you populate some clientside html
| elemetns and postback through them, it will violate the event
validation...
|
| You can either turn off this feature at Page Level through the @Page
| directive or in the web.config 's <pages> setting .... (for the whole
web
| application).
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
| --------------------
| | From: "Daniel Walzenbach" <da***************@newsgroup.nospam>
| | References: <eV**************@TK2MSFTNGP09.phx.gbl>
| | Subject: Re: postback problem
| | Date: Mon, 14 Nov 2005 02:14:21 +0100
| | Lines: 47
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| | X-RFC2646: Format=Flowed; Response
| | Message-ID: <uz**************@TK2MSFTNGP10.phx.gbl>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: p54AC0C93.dip0.t-ipconnect.de 84.172.12.147
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:357799
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | TIA,
| |
| |
| |
| | as the error message indicates asp.net >= 1.1 in the default
| configuration
| | hinders changes made on the client to prevent XSS (Cross Site
Scripting).
| If
| | you don't want this support you can change <pages
| | enableEventValidation="true"/> to <pages
enableEventValidation="false"/>
| or
| | set <%@ Page EnableEventValidation="true" %> to <%@ Page
| | EnableEventValidation="false" %> in the one page you want to allow
| changes
| | made to your dropdownlists. Be sure though to check EVERY value on the
| | server. Remember: ALL INPUT IS EVIL!!!
| |
| |
| |
| | Regards
| |
| |
| |
| | Daniel Walzenbach
| |
| |
| |
| |
| |
| | <pa***@community.nospam> schrieb im Newsbeitrag
| | news:eV**************@TK2MSFTNGP09.phx.gbl...
| | > Hi all,
| | >
| | > I have a bunch of dropdownlists that are populated in client-side
| | > javascript. When i do a postback I get the following 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.
| | >
| | > Any Ideas? What can I do to fix it?
| | >
| | > TIA!
| | >
| |
| |
| |
|
|

Nov 20 '05 #4

P: n/a
Is Turning Off this new "feature" the only option here? Because I have
the same problem and would like to leave this on if possible. In my
page AND my composite control which contains the drop down lists I
have code like this

Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
For Each control As Control In Me.Controls
Me.ClientScript.RegisterForEventValidation(control .ID)
Next
MyBase.Render(writer)
End Sub

and the page still blows up when I click a button on the web page that
uses the control.

If any one sees where I have erred please do tell.

Nov 29 '05 #5

P: n/a
Will anyone from Microsoft please comment on this issue?
I am trying to use a GridView control in a UserControl and even the turning
off of the EnableEventValidation option does not help when the grid is in
edit mode!
Thanks,
Momtchil

"markstimo" wrote:
Is Turning Off this new "feature" the only option here? Because I have
the same problem and would like to leave this on if possible. In my
page AND my composite control which contains the drop down lists I
have code like this

Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
For Each control As Control In Me.Controls
Me.ClientScript.RegisterForEventValidation(control .ID)
Next
MyBase.Render(writer)
End Sub

and the page still blows up when I click a button on the web page that
uses the control.

If any one sees where I have erred please do tell.

Dec 2 '05 #6

P: n/a

Have you come to a resolution on this? Is there a way to disable the
event validation for a single control on a page, rather than turning
off event validation for the entire page (by using the @Page directive
EnableEventValidation="false" ).

I too would rather not turn this feature off for everything on the
page. I'd rather bypass the validation check on the single
dropDownList that has the problem. I'm fiddling around with the code,
and trying to search out information on the correct way to do this, but
I wondering if it's even possible.

Any luck getting this to work?

--steve

Dec 9 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.