473,387 Members | 1,891 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,387 software developers and data experts.

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 2658
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.