Ошибка: неверный аргумент обратной передачи или обратного вызова

Я получаю следующую ошибку при нажатии кнопки с gridview

 Server Error in '/' Application.
Invalid postback or callback argument.  Event validation is enabled using  in configuration or  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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Invalid postback or callback argument.  Event validation is enabled using  in configuration or  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.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ArgumentException: Invalid postback or callback argument.  Event validation is enabled using  in configuration or  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.]
   System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +144
   System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +29
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

Это происходит, когда я нажимаю кнопку внутри вида сетки, и странным является то, что у меня есть другой вид сетки, также с настраиваемой кнопкой в столбце, который запускает другой код, но не дает ошибок. Ниже приведен код страницы и код позади.

namespace CCCC
{
    public partial class drivermangement : System.Web.UI.MasterPage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {
                if (Roles.IsUserInRole("Administrator"))
                {
                    LoggedInUser.Value = Convert.ToString(Request.QueryString["driver"]);
                }
                else
                {
                    LoggedInUser.Value = Membership.GetUser().UserName.ToString();
                }
                DayOfTheWeekHiddenField.Value = Convert.ToString(Request.QueryString["dow"]);
            }
            else
            {
                Response.Redirect("default.aspx");
            }
            if (NewCustomersGrid.Rows.Count == 0)
            {
                NewCustomersLabel.Visible = false;
            }
            else
            {
                NewCustomersLabel.Visible = true;
            }
            if (NeedCompostGrid.Rows.Count == 0)
            {
                NeedCompostLabel.Visible = false;
            }
            else
            {
                NeedCompostLabel.Visible = true;
            }
            if (CanceledGrid.Rows.Count == 0)
            {
                CanceledLabel.Visible = false;
            }
            else
            {
                CanceledLabel.Visible = true;
            }
            if (VacationGrid.Rows.Count == 0)
            {
                VacationLabel.Visible = false;
            }
            else
            {
                VacationLabel.Visible = true;
            }
            if (NewCustomersGrid0.Rows.Count == 0)
            {
                NewCustomersLabel0.Visible = false;
            }
            else
            {
                NewCustomersLabel0.Visible = true;
            }
            if (NeedCompostGrid0.Rows.Count == 0)
            {
                NeedCompostLabel0.Visible = false;
            }
            else
            {
                NeedCompostLabel0.Visible = true;
            }
            if (CanceledGrid0.Rows.Count == 0)
            {
                CanceledLabel0.Visible = false;
            }
            else
            {
                CanceledLabel0.Visible = true;
            }
        }

        protected void NewCustomerDoneButton_Click(object sender, EventArgs e)
        {
            int CustomerID = Convert.ToInt32(((Button)sender).CommandArgument);
            string CustomerBinNeedAcknowledged = "Yes";
            string strConnString = "Data Source";
            using (SqlConnection con = new SqlConnection(strConnString))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection = con;
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = "UPDATE Customers SET CustomerBinNeedAcknowledged=@CustomerBinNeedAcknowledged WHERE CustomerID=@CustomerID";
                    cmd.Parameters.AddWithValue("@CustomerBinNeedAcknowledged", CustomerBinNeedAcknowledged);
                    cmd.Parameters.AddWithValue("@CustomerId", CustomerID);
                    con.Open();
                    cmd.ExecuteNonQuery();
                    con.Close();
                }
            } 
       }

и фактическая страница: я





    
    
    
        
        
<br>









                

















        

Теперь мне интересно, это как-то связано с тем, чтоGridView находится внутриAjax Tab Container? Потому что моя другая таблица, которая работает нормально, не ...

Примечание: пришлось вырезать некоторый код со страницы из-за ограничений на количество символов

Ответы на вопрос(5)

Ваш ответ на вопрос