I have been following the tutorials from Scott Mitchell on this site. I am trying to insert a new record from the gridview footer. I have my BLL set up as a .cs class in the App Code folder. When I fill in the fields and click add, nothing happens. The page refreshes and the text boxes empty, but nothing is added to the database. The edit and delete functions work fine. Have I put something in the wrong spot?
I have the rowcommand and the datasource_inserting on the code page as below.
protected void Oems_RowCommand(object sender, GridViewCommandEventArgs e)
// Insert data if the CommandName == "Insert"
// and the validation controls indicate valid data...
if (e.CommandName == "Insert" && Page.IsValid)
// TODO: Insert new record...
protected void OemsDataSource1_Inserting
(object sender, ObjectDataSourceMethodEventArgs e)
// Programmatically reference Web controls in the inserting interface...
TextBox txtOem = (TextBox)GridView1.FooterRow.FindControl("txtOem");
TextBox txtOemStreet = (TextBox)GridView1.FooterRow.FindControl("txtOemStreet");
TextBox txtOemCity = (TextBox)GridView1.FooterRow.FindControl("txtOemCity");
View Complete Post