S
SSP
Dear .NETters,
I am unable to get the _UpdateCommand event to fire on one of my web forms.
The Update Linkbutton has the following URL linked to it...
javascript:{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate()) __doPostBack('DataGrid1$_ctl13$_ctl2','')}
Following is the _UpdateCommand code...
||||||||||||
private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
string NewUName, NewUserEmail;
TextBox tbox;
tbox= (TextBox) e.Item.Cells[0].Controls[0];
NewUName = tb.Text;
tbox = (TextBox) e.Item.Cells[1].Controls[0];
NewUserEmail = tbox.Text;
TableCell UNameCell = e.Item.Cells[0];
TableCell UserEmailCell = e.Item.Cells[1];
TextBox UNameBox = (TextBox)UNameCell.Controls[0];
TextBox UserEmailBox = (TextBox)UserEmailCell.Controls[1];
string UName = System.String.Format(UNameBox.Text);
string UserEmail = System.String.Format(UserEmailBox.Text);
oleDbUpdateCommand1.Parameters["UserEmail"].Value = UserEmail;
oleDbUpdateCommand1.Parameters["UName"].Value = UName;
oleDbConnection1.Open();
oleDbDataAdapter1.Update(dsTeamMembers1);
oleDbConnection1.Close();
DataGrid1.EditItemIndex = -1;
DataGrid1.DataBind();
}
||||||||||||
Any clues?
SSP
I am unable to get the _UpdateCommand event to fire on one of my web forms.
The Update Linkbutton has the following URL linked to it...
javascript:{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate()) __doPostBack('DataGrid1$_ctl13$_ctl2','')}
Following is the _UpdateCommand code...
||||||||||||
private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
string NewUName, NewUserEmail;
TextBox tbox;
tbox= (TextBox) e.Item.Cells[0].Controls[0];
NewUName = tb.Text;
tbox = (TextBox) e.Item.Cells[1].Controls[0];
NewUserEmail = tbox.Text;
TableCell UNameCell = e.Item.Cells[0];
TableCell UserEmailCell = e.Item.Cells[1];
TextBox UNameBox = (TextBox)UNameCell.Controls[0];
TextBox UserEmailBox = (TextBox)UserEmailCell.Controls[1];
string UName = System.String.Format(UNameBox.Text);
string UserEmail = System.String.Format(UserEmailBox.Text);
oleDbUpdateCommand1.Parameters["UserEmail"].Value = UserEmail;
oleDbUpdateCommand1.Parameters["UName"].Value = UName;
oleDbConnection1.Open();
oleDbDataAdapter1.Update(dsTeamMembers1);
oleDbConnection1.Close();
DataGrid1.EditItemIndex = -1;
DataGrid1.DataBind();
}
||||||||||||
Any clues?
SSP