473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom postback code and RegsiterForEven tValidation

Hi.
Is there some KB article how to use EnableEventVali dation when doing
customized posts? Basicly we're building a post string via javascript
and issue it via means of XMLHttpRequest to the server.
This worked fine in .NET 1.1

Now in ASP.NET 2.0 I get an error message: 'Invalid postback or callback
argument. Event validation is enabled using <pages
enableEventVali dation="true"/in configuration or <%@ Page
EnableEventVali dation="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
ClientScriptMan ager.RegisterFo rEventValidatio n method in order to
register the postback or callback data for validation.'

But even after I add the RegisterForEven tValidation call I still get
this error message. So I'd be interested in what one has to do to setup
ones' code for postback to the server. (I didn't yet disassemble the
asp.net code).

Regards
Andreas
Mar 30 '07 #1
1 1643
event validation checks that only enabled and rendered (visible)
controls (status stored in viewstate) and with eventhandlers are posting
back for event handling. for controls with a know set of values (say a
drop down) asp.net also checks the value is in range. this is
implemented for several built in controls.

registerforeven tvalidation allows you to add this feature to your own
custom controls. it must be called during render and once for every
legal postback value (clientid,value ), once to allow clientpostback
(clientid).

you can turn this feature off at site (web config) or page level with
EnableEventVali dation.

-- bruce (sqlwork.com)

Andreas Bergmeier wrote:
Hi.
Is there some KB article how to use EnableEventVali dation when doing
customized posts? Basicly we're building a post string via javascript
and issue it via means of XMLHttpRequest to the server.
This worked fine in .NET 1.1

Now in ASP.NET 2.0 I get an error message: 'Invalid postback or callback
argument. Event validation is enabled using <pages
enableEventVali dation="true"/in configuration or <%@ Page
EnableEventVali dation="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
ClientScriptMan ager.RegisterFo rEventValidatio n method in order to
register the postback or callback data for validation.'

But even after I add the RegisterForEven tValidation call I still get
this error message. So I'd be interested in what one has to do to setup
ones' code for postback to the server. (I didn't yet disassemble the
asp.net code).

Regards
Andreas
Mar 30 '07 #2

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

Similar topics

1
4559
by: apple | last post by:
Hello, please help me I create a set of custom controls with IPostBackDataHandler, and postback processing. All worked correctly, only custom checkbox control postback value change only if I do change status to enabled/checked. So, I can only set status to checked, not the other. How I can correct this, may be this is because I use Objects in...
2
3179
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/creatingcustomcolumns.asp The problem I am having is that the data in the custom datagridcolumn is not saved to viewstate and after...
1
1963
by: Lamont Adams | last post by:
Hi all, I've created numerous custom controls of varying complexity, but I've been on this problem for a day and a half, and I can't figure this mystery out. I hope one of you kind folks can point out the really obvious and stupid thing I'm overlooking here. :) I have a custom control that provides a tasklist similar to what you get in...
1
2616
by: Martin | last post by:
Hi, I have produced a custom server control that simple outputs a row of 26 buttons, one button for each letter of the english alphabet. now what I would like to do is catch the button click inside the server control when it is clicked on. however when I click on a button at present I get an error saying that the An error has occurred...
7
2977
by: Shimon Sim | last post by:
I have a custom composite control I have following property
5
2633
by: | last post by:
Hi all, Has anyone been able to write some custom javascript on the onclick event of submit button to do certain things like disable submit button, only submit form once etc. This was a breeze in 1.1 since I could edit the .js file. Now in 2.0 I can no longer do this. Also, my code would have to be called after all client-side validation...
5
2332
by: Alan Silver | last post by:
Hello, I have a products page that takes a product ID in the query string. Based on the product details (from a database), the page then loads up one of a number of custom controls, calls a method in the control (that displays product info) and then loads the control into a placeholder so it will be displayed. I want to be able to...
2
1857
by: J R M | last post by:
I've developed a custom control (it's basically a drop-down list and then a couple of textboxes to include meta-data for the selection) that I'm embedding into another custom control (the idea is to allow a dynamic number of control1 to appear in control2). Everything renders correctly, however I could never retrieve data on postback from my...
2
9629
cameokid
by: cameokid | last post by:
Hi, I have a table with some form fields. This table is hidden on load. I display it on click of a button. After i enter values and click button inside this table. It displays the custom validation error inside table (I want the error msg to be displayed inside table) but causes postback and hides the table. How do I stop the postback and...
0
7701
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.