postback problem

G

Guest

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!
 
D

Daniel Walzenbach

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
 
S

Steven Cheng[MSFT]

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" <[email protected]>
| References: <[email protected]>
| 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: <[email protected]>
| 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!TK2MSFTNGP10.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
|
|
|
|
|
| | > 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!
| >
|
|
|
 
S

Steven Cheng[MSFT]

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: <[email protected]>
<[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (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: <[email protected]>
| 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" <[email protected]>
| | References: <[email protected]>
| | 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: <[email protected]>
| | 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!TK2MSFTNGP10.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
| |
| |
| |
| |
| |
| | | | > 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!
| | >
| |
| |
| |
|
|
 
M

markstimo

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.
 
G

Guest

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
 
N

n33470

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top