473,495 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

postback problem

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
6 2665
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
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
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
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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3873
by: Igor Belagorudsky | last post by:
Hi, i am trying to analyze data submitted in a form but the problem is that when i try to create the controls in code (which is what i want to do), it throws an obect not found exception on...
0
1533
by: Xavier Osa | last post by:
Hi, I have an ASP.Net web page that you can download a file. As Fergunson's problem, it prompts twice dialog boxes only if I select Open button. If I select Save button, it prompts once. I'm...
1
3632
by: Mad Scientist Jr | last post by:
I don't know how this is happening, but a dropdown control I have is resetting to the 2nd value on the list anytime a postback occurs. I have no initiation code outside of If Not (IsPostBack) ...
10
4474
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
2
4312
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
1
17020
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
1
1359
by: Jason | last post by:
I have a webpage that I've wrapped in an Atlas UpdatePanel. This page contains four textboxes, each with AutoPostBack set to true. The problem comes when someone edits the first box and tabs to...
11
14786
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
15
3590
by: mc | last post by:
I'm writing an app for managing Task Lists, I'm trying to add some controls to a form that I can use to link tasks, my original intention was to: - Add two list boxes, one listing "all Tasks"...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6878
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
5456
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,...
1
4897
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...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.