Jayasurya Satheesh
Jayasurya Satheesh

Reputation: 8033

Drop ASP.Net Drop Down SelectedIndex_Changed Not Working

I have the following code for the DropDown Selected Index Changed. But It's not firing the event as expected

<asp:DropDownList ID="DropCourseLevel" runat="server" CssClass="form-control m-input" 
AutoPostBack="true" OnSelectedIndexChanged="DropCourseLevel_SelectedIndexChanged" >
</asp:DropDownList>

I'm getting the following error in the Console

Uncaught Error: Sys.WebForms.PageRequestManagerServerErrorException: 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.

Any Help is much appreciated

Upvotes: 2

Views: 451

Answers (2)

Jayasurya Satheesh
Jayasurya Satheesh

Reputation: 8033

I was Able to resolve the Issue by adding EnableEventValidation="false" on my page's code

<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" 
CodeBehind="Application.aspx.cs" Inherits="USI.User.Application" 
Title="Course Application" MasterPageFile="~/User/MyPage.Master" %>

Upvotes: 0

Hussein Salman
Hussein Salman

Reputation: 8236

Try Setting this property on your aspx page as:

EnableEventValidation="false"

Upvotes: 2

Related Questions