<?xml version="1.0"?> <Root> <FileName Name="RootProcess"> <Id>727683220</Id> <FileName>adsf</FileName> <FilePath>d:\manohar\adsf.xml</FilePath> <Description>fsad sdfa</Description> </FileName> <FileName Name="PlantProcess"> <Id>1362537878</Id> <FileName>PlantProcess</FileName> <FilePath>PlantProcess</FilePath> <Description> sdf sdf</Description> </FileName> <FileName Name="LogData"> <Id>1362537878</Id> <FileName>LogData</FileName> <FilePath>PlantProcess</FilePath> <Description> sdf sdf</Description> </FileName> </Root>
If (IO.File.Exists(Server.MapPath("~/App_Data/XMLFile.xml"))) Then For Each gvrow As GridViewRow In dgvXmlPathSetting.Rows 'Finiding checkbox control in gridview for particular row Dim chkdelete As CheckBox = DirectCast(gvrow.FindControl("chkdelete"), CheckBox) 'Condition to check checkbox selected or not If chkdelete.Checked = True Then 'Getting UserId of particular row using datakey value Dim lblId As Label = DirectCast(gvrow.FindControl("lblId"), Label) Dim FileName As Label = DirectCast(gvrow.FindControl("lblFIleName"), Label) Dim xmldoc As New XmlDocument() xmldoc.Load(Server.MapPath("~/App_Data/XMLFile.xml")) Dim nodes As XmlNodeList = xmldoc.SelectNodes("//Root/FileName[@Name='" & FileName.Text.Trim() & "']") 'Dim nodes As XmlNodeList = xmldoc.SelectNodes("/Root/FileName[@Name="" & FileName & ""]") For i As Integer = nodes.Count - 1 To 0 Step -1 nodes(i).ParentNode.RemoveChild(nodes(i)) Next ' reader.Close() xmldoc.Save(Server.MapPath("~/App_Data/XMLFile.xml")) End If Next loadXmlToGridview() End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)