Click here to Skip to main content
13,293,698 members (64,371 online)
Rate this:
Please Sign up or sign in to vote.
I have a dropdownlist and gridview inside an update panel whereby the data in gridview will change according to dropdownlist selectedindexchanged.
However, I just receive this kind of error which i never get before.
what does it mean and how can I solve this?

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: 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.
Posted 17-Jul-12 2:11am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Put your dropdown inside trigger of your update panel:
Try below code:

               <asp:asyncpostbacktrigger controlid="YourDropdown" eventname="SelectedIndexChanged" />
snamyna 17-Jul-12 22:29pm
Somehow other labels and textboxes also get the same effect as the same error popup. I have googled n found some solution where they ask to put EnableEventValidation="false" on my page.
How this solution will effect my website?
Girish .Markunda 30-Oct-12 5:44am
sir,i wanted to change the content of gridview as per the selection that i am making in my DropDownlist and that selected value i wanted to pass my stored procedure as input parameter and i wanted to pass without using button

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
string ConnectionString = ConfigurationManager.ConnectionStrings["GirishTestConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(ConnectionString);
var @class = DropDownList2.SelectedValue;
string st = @class;
// SqlDataReader rd;
SqlCommand cmd = new SqlCommand("DBTest2_sp", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@class", DropDownList2.SelectedValue);
SqlDataAdapter sqlda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
GridView1.DataSource = ds;


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171207.1 | Last Updated 17 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100