0

I have a page with a bunch of text inputs, dropdowns, and buttons. All manipulation of the inputs is done server side. Javascript only adds event listeners which manipulate the contents of the text inputs.

When I remove the unnecessary (dimmed)

using System.Web.UI

I get the annoying "Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation=\"true\"/> in configuration or <%@ Page EnableEventValidation=\"true\" %> in a page. ...

When I put it back in the problem goes away.

enter image description here

Removing javascript and all processing in Page_Load does not make the problem go away.

How weird is that? What is going on here?

Matt
  • 4,261
  • 4
  • 39
  • 60
  • Can't reproduce for a simple setup (textboxes & submit button control) with `System.Web.UI` import line commented out. Can you provide further details including example page markup and code-behind? – Tetsuya Yamamoto Jul 12 '18 at 04:09

1 Answers1

0

Turns out it was caused by a line break in a <asp:ListItem>Big long item with a line break</asp:ListItem>.

Presumably, when the item with the line break was selected, the returned HTML no longer matched the source (since line breaks are converted to a space character).

Matt
  • 4,261
  • 4
  • 39
  • 60