This is a migrated thread and some comments may be shown as answers.

Avoiding the Event Validation Error when changing a Listbox's contents

3 Answers 74 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 25 Jan 2012, 07:20 PM
I've encountered a problem with the standard Microsoft ListBox, as described here: http://forums.asp.net/p/1762321/4800943.aspx/1?Re+Getting+Validation+Error+Upon+Update+of+a+ListBox+s+Contents

Note that the first response provided is absolutely incorrect.  The problem apparently occurs when a new item is added to the listbox or an existing item is changed.  BUT THAT'S PRECISELY WHAT I NEED TO DO!!!

Rather than wasting hours/days trying to resolve this problem with the standard ListBox, I thought the easiest solution might just be to use Telerik's ListBox instead.  In anticipation of that, is there any particular approach I should use to updating the ListBox to avoid this dreaded Event Validation error?

Robert

3 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 25 Jan 2012, 08:30 PM
I've now switched things over to the RadListBox but unfortunately am getting the same error.

For the record, the RadListBox sits within an UpdatePanel, which itself sits within a RadWindow.

Here's the code I used to add an item:

      listBoxEditRoles.Items.Add(new RadListBoxItem(roleName));
      listBoxEditRoles.SelectedIndex = listBoxEditRoles.Items.Count - 1;

But unfortunately got the aforementioned error involving the "Invalid postback or callback argument".

So what am I doing wrong and how do I resolve this?

Robert
0
Peter Filipov
Telerik team
answered on 30 Jan 2012, 12:46 PM
Hi Robert,

From the information provided, I am not able to recreate your scenario.
Could you please send me a working sample project that demonstrates the issue to investigate it locally?

Greetings,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Robert
Top achievements
Rank 1
answered on 30 Jan 2012, 06:30 PM
Peter,

I have since resolved the problem. 

Thank you for your consideration,

Robert
Tags
ListBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or