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 enableEventVali dation="true"/in configuration or <%@ Page
EnableEventVali dation="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 ClientScriptMan ager.RegisterFo rEventValidatio n method in
order to register the postback or callback data for validation.
--
MCP Year 2005, Philippines
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 enableEventVali dation="true"/in configuration or <%@ Page
EnableEventVali dation="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 ClientScriptMan ager.RegisterFo rEventValidatio n 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();
}
MCP Year 2005, Philippines