グリッドビューの行を選択してレコードを更新および削除したいとします。このコードは従業員の詳細を追加するためのコードです。更新するためasp.netのxmlファイルからgridviewを使用してレコードを削除および更新する方法
protected void Button_Add_Employee_Click(object sender, EventArgs e)
{
XmlDocument xmlEmloyeeDoc = new XmlDocument();
xmlEmloyeeDoc.Load(Server.MapPath("~/Employees.xml"));
XmlElement ParentElement = xmlEmloyeeDoc.CreateElement("Employee");
XmlElement ID = xmlEmloyeeDoc.CreateElement("ID");
ID.InnerText = TextBox_Id.Text;
XmlElement Name = xmlEmloyeeDoc.CreateElement("Name");
Name.InnerText = TextBox_Name.Text;
XmlElement Designation = xmlEmloyeeDoc.CreateElement("Designation");
Designation.InnerText = TextBox_Desig.Text;
ParentElement.AppendChild(ID);
ParentElement.AppendChild(Name);
ParentElement.AppendChild(Designation);
xmlEmloyeeDoc.DocumentElement.AppendChild(ParentElement);
xmlEmloyeeDoc.Save(Server.MapPath("~/Employees.xml"));
BindGrid();
}``