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

PostBack Problems

I have 2 ListBoxes which get populated with records from a database.
The Form has a Button as well. Note that users can select multiple
items in both the ListBoxes.

When a user selects items from the 1st ListBox & clicks the Button,
the selected items get deleted from the 1st ListBox & get appended to
the 2nd ListBox at the very end. I also want that the items that have
just got appended to the 2nd ListBox should also get selected. In
other words, to view the just appended items in the 2nd ListBox, I
don't want users to scroll down the 2nd ListBox to view the newly
appended items. Instead, the 2nd ListBox should automatically scroll
down after the items get appended to the 2nd ListBox.

I am trying to do this using JavaScript (using the OnClientClick event
of the Button server control) but ASP.NET generates 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.

I tried to overcome this error by adding the following code:

Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
MyBase.Render(writer)
ClientScript.RegisterForEventValidation(lstBox1.ID )
End Sub

but that doesn't make any difference. The error still persists.

If I set EnableEventValidation to False in the Page directive, then
the error doesn't get generated but at the same time, the items
selected in the 1st ListBox do not get appended to the 2nd ListBox.

Can someone please give me some idea on how do I overcome this error?

Mar 7 '07 #1
0 1369

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

Similar topics

6
by: V | last post by:
I have found that when I have a composite control that uses the CreateChildControls method, on a regular page load, Page_Load executes before CreateChildControls, but on a postback it is the...
2
by: Cindy | last post by:
Hi all you smarties out there, I'm having a little conundrum with my asp.net page Scenario: I have a form (asp.net) with no code behind (as yet). I have placed a javascript function on a...
4
by: Mervin Williams | last post by:
Postbacks cause a webform to re-display the page at the top. Well, I have a fairly long form and would like the page display to be re-positioned where the user clicked the button that caused the...
4
by: Raterus | last post by:
Howdy, Simple question, but I can't figure out how to do it. I have a a page which is called initially with a querystring. After I get the querystring values, I don't need the querystring to...
4
by: Jeremy | last post by:
I have an ASPX page with a bunch of System.Web.UI.WebControls.Button controls on it. By default, clicking on any of these causes a Postback. I'd like to have it so that for a couple of these...
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...
7
by: Anand | last post by:
Hi All, The postback on my desktop stopped working. I am trying to run the webapplication locally on my desktop and the Postback on my home page won't trigger on any of my dropdown selections. The...
6
by: Bryan | last post by:
I've got an ASP.NET application running that has a non-visual user interface (it's a voice app using VXML.) The voice client understands cookies and when it requests and aspx page, what actually...
3
by: Chad Grooms, MCSD | last post by:
Here's an issue I haven't seen before now, and I am wondering if anyone else has experienced this... I have an web application (asp.net,vb) that has worked fine for quite a while. Now, For some...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.