1

As title, would this raise the same problem like Invalid postback or callback argument. Event validation is enabled using '<pages enableEventValidation="true"/>' ?

Thank you

Community
  • 1
  • 1
Ricky
  • 34,377
  • 39
  • 91
  • 131

2 Answers2

1

No, no exception will be raised, you can safely post with a value changed using JavaScript. I have personally used that approach to persist some important information across the postbacks. Example code:

Sys.Application.add_load(function() {
            document.getElementById("HiddenField").value = "This value is going to be persisted across the postbacks";
        });



<asp:HiddenField runat="server" ID="HiddenField" />
Genady Sergeev
  • 1,650
  • 9
  • 11
1

Yes.

According to http://msdn.microsoft.com/en-us/magazine/cc163512.aspx

The page basically matches the contents of the request with the information in the __EVENTVALIDATION field to verify that no extra input field has been added on the client and that value is selected on a list that was already known on the server.

So this won't violate either of the rules.

Martin Smith
  • 438,706
  • 87
  • 741
  • 845