Hi I want to delete record form XML file on the click of asp.net button. But is generated on runtime from AngularJS

Below is my XML file which I use to display data in table format


Here is my HTML code with that my data coming in table format

<div ng-app="myApp" ng-controller="myCtrl">
            <table border="1" width="100%">
                    <th>Employee ID</th>
                    <th>Employee Name</th>
                    <th>Email ID</th>
                <tr ng-repeat="detail in details" align="center">
                        <asp:Button CssClass="btnDelete" Text="Delete Record" runat="server" ng-click="getID(detail.EmployeeID)" OnClick="btnDelete_Click"/>

Here is my AngularJS code with that I m get changing XML to JSON and present in the form of table

        var app = angular.module('myApp', []);
        app.controller('myCtrl', function ($scope, $http) {
            .then(function (response) {
                var x2js = new X2JS();
                $scope.details = [];
                var data = x2js.xml_str2json(response.data);
                $scope.details = data.UserDetail.Detail;
                $scope.getID = function (id) {                 
                    if (this == id)
                        $scope.UserDetail.Detail.splice(index, 1);


My Delete Record button code

protected void btnDelete_Click(object sender, EventArgs e)
    var xDoc = XDocument.Load(@"D:\test\myDB.xml");
       .Where(x => x.Value == id)

Help me to delete record from XML file

Related posts

Recent Viewed