I have the following very simple form:
<asp:UpdatePanel ID="ClaimRewardsForm" runat="server">
<ContentTemplate>
<span class="largeBold">Select jacket weight:</span><br />
<asp:RadioButtonList runat="server" ID="JacketWeight">
<asp:ListItem Value="Lightweight" Text="Lightweight (fleece)" />
<asp:ListItem value="Heavyweight" Text="Heavyweight (cotton)" />
</asp:RadioButtonList>
<br />
<span class="largeBold">Select size:</span><br />
(Men's sizes only)<br />
<asp:DropDownList ID="JacketSize" runat="server">
<asp:ListItem Value="Small" Text="Small" />
<asp:ListItem Value="Medium" Text="Medium" />
<asp:ListItem Value="Large" Text="Large" />
</asp:DropDownList><br />
<br />
<asp:ImageButton ID="SubmitButton" runat="server" ImageUrl = "~/Content/Images/submitButton.png" onclick="SubmitButton_Click" />
</ContentTemplate>
</asp:UpdatePanel>
In my button's click handler, I have:
protected void SubmitButton_Click(object sender, EventArgs e)
{
if (IsValid)
{
using (var work = UnitOfWorkFactory.Create())
{
var id = new Guid(Session["id"].ToString());
var account = UserAccounts.Get(id);
if (account == null)
throw new Exception("Invalid user account id.");
account.RewardInfo.Clear();
account.RewardInfo.Add(new RewardInfo()
{
UserAccount = account,
JacketWeight = JacketWeight.SelectedValue,
JacketSize = JacketSize.SelectedValue
});
work.Commit();
}
//ClaimRewardsForm.Update();
//ScriptManager.RegisterStartupScript(this, GetType(),
// "confirmation", "ClaimRewards.showConfirmation();", true);
}
}
I'm not modifying the form fields in any way whatsoever, but I'm still getting the following error:
505|error|500|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.|
Since I'm not modifying teh controls at all during the post back, I cannot for the life of me figure out why it's acting as if I had. Any thoughts?