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

4 posts, 0 answers
  1. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 25 Jan 2012 Link to this post

    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
  2. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 25 Jan 2012 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 30 Jan 2012 Link to this post

    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
  5. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 30 Jan 2012 Link to this post

    Peter,

    I have since resolved the problem. 

    Thank you for your consideration,

    Robert
Back to Top