Edit Command Gridview

D

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?
Thanks.

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.

Code:
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;
gdvLinks.DataBind();
}

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

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

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top