I have a repeater that contains a few items and among them there are a DropDownList and a Button.
The goal here is to associate an item from the DDL with the selected repeater row.
ASPX Code:
<asp:Repeater ID="sharedPlansList" runat="server"
onitemdatabound="sharedPlansList_ItemDataBound"
onitemcommand="sharedPlansList_ItemCommand">
<ItemTemplate>
<div>
<h1>· <%# Eval("ProductName") %></h1>
<div>
Associer le domaine :
<asp:DropDownList runat="server" ID="domainList" />
<asp:Button ID="associateDomaine" Text="Associer" runat="server"
CommandArgument='<%# Container.DataItem %>' />
</div>
<div>
Domaines :
<asp:BulletedList runat="server" ID="sharedPlanDomains" />
</div>
</div>
</ItemTemplate>
</asp:Repeater>
The problem:
When I click the button I have each time an Invalid Postback or Callback exception ( Invalid postback or callback argument. Event validation is enabled using 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. ). But everything seems really standard without anything really exotic. I do not add anything or controls by javascript either.
I have seen solutions where you could put <pages enableEventValidation="false" />
in the web.config
but I am not sure it's a good solution since I want to make sure to keep the asp.net built-in security model.
Does any work-around exist?