1
  <asp:DropDownList ID="ddlPlace"   OnSelectedIndexChanged="ddlPlace_OnSelectedIndexChanged" AutoPostBack="True" runat="server"></asp:DropDownList>

 var places = new PlaceRepository().Read().ToList();
            ddlPlace.DataTextField = "Title";
            ddlPlace.DataValueField = "ID";
            ddlPlace.DataSource = places;
            ddlPlace.DataBind();

protected void ddlPlace_OnSelectedIndexChanged(object sender, EventArgs e)
    {
        Page.Response.Redirect(SPContext.Current.Site.Url + "/Pages/pageneame.aspx?ID=" + ddlPlace.SelectedValue);
    }

i get this error:

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.

I'm using publishing page in pages libarary to add this webpart.

How i can solve it?

Fouad
  • 35
  • 1
  • 7

1 Answers1

1

Guys i answer my question

this error happened because of using ID in URL and this ID make conflict with SharePoint page ID.

Fouad
  • 35
  • 1
  • 7