How we can remove a xml node in javascript in asp.net C#?
i tried this but is given me an error...
ScriptManager.RegisterStartupScript(UpdatePanel1,this.GetType(),"RemoveDock",
string.Format(@"function _removeDock()
{
xmlDoc = loadXMLDoc('c:\teste\Config.xml');
x= xmlDoc.getElementsByTagName('Object');
for (i=0;i<x.length;i++)
{
if(x[i].childNodes[0].nodeValue == '{0}')
{
xmlDoc.documentElement.removeChild(x[i]);
}
}
};", HiddenField1.ClientID),true);
My xml is this
<?xml version="1.0"?>
<Form NrForm="Value" State="Value">
<Object Type="TextBox">
<ObjectNr>texto valor</ObjectNr>
<Type>TextBox</Type>
<Id>RadDocka47ebc1f-848a-4bef-8f31-bc680d776564</Id>
<x1>Text Label</x1>
<x2>35</x2>
<x3>Text</x3>
<x4>Text</x4>
</Object>
<Object Type="TextBox">
<ObjectNr>texto valor</ObjectNr>
<Type>TextBox</Type>
<Id>RadDocka47ebc1f-848a-4bef-8f31-bc680d776564</Id>
<x1>Text Label</x1>
<x2>35</x2>
<x3>Text</x3>
<x4>Text</x4>
</Object>
</Form>
and i want to eliminate one of this
<Object Type="TextBox">
<ObjectNr>texto valor</ObjectNr>
<Type>TextBox</Type>
<Id>RadDocka47ebc1f-848a-4bef-8f31-bc680d776564</Id>
<x1>Text Label</x1>
<x2>35</x2>
<x3>Text</x3>
<x4>Text</x4>
</Object>