Edit Command Gridview


den 2005

Hi everybody,

I am not familiar using Gridview, I created a Gridview with Edit Command
Button, but when I click the update Command button this error message below
is displayed, what and where is the problem? I am confused. Can anyone show
me exactly to do edit process of Gridview using Edit Command button properly?

Error Message:
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.

protected void gdvLinks_RowEditing(object sender, GridViewEditEventArgs e)
gdvLinks.EditIndex = e.NewEditIndex;
for (int x = 0; x < gdvLinks.Columns.Count; x++)
gdvLinks.Columns[x].Visible = true;
gdvLinks.DataSource = dtLinks;

protected void gdvLinks_RowUpdating(object sender,
GridViewUpdateEventArgs e)
gdvLinks.EditIndex = -1;

//Loading datasource not using SqlDatasource control
private void LoadLinkGrid()
gdvLinks.DataSource = dtLinks;


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question