I have this small snippet below and i want to save some data back to the xml
file.
So i looked for a node and checked if the node value is the same as a
textbox value
and if yes i pass in the new value entered from a textbox back t the xml
datasource.
I'm populating values of the textboxes from an xml dtrasource
But it doesn't see to work am i missing something
Thanks in advance
string g = bbW;
if (node["Weighting"].InnerText == Weighting.Text)
{
node["Weighting"].InnerText = g;
}
-------------------------------------------------
code below
public void saveXmlData(str ing bbW)
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Loa d(Server.MapPat h("WT.xml"));
XmlNodeList nodeList = xmlDocument.Sel ectNodes("//WeightingsRep") ;
foreach (XmlNode node in nodeList)
{
//Response.Write( "todd:" + bbW);
string g = bbW;
if (node["Weighting"].InnerText == Weighting.Text)
{
node["BBWeightin g"].InnerText = g;
}
}
xmlDocument.Sav e(Server.MapPat h("WT.xml"));
xmlDocument = null;
}
file.
So i looked for a node and checked if the node value is the same as a
textbox value
and if yes i pass in the new value entered from a textbox back t the xml
datasource.
I'm populating values of the textboxes from an xml dtrasource
But it doesn't see to work am i missing something
Thanks in advance
string g = bbW;
if (node["Weighting"].InnerText == Weighting.Text)
{
node["Weighting"].InnerText = g;
}
-------------------------------------------------
code below
public void saveXmlData(str ing bbW)
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Loa d(Server.MapPat h("WT.xml"));
XmlNodeList nodeList = xmlDocument.Sel ectNodes("//WeightingsRep") ;
foreach (XmlNode node in nodeList)
{
//Response.Write( "todd:" + bbW);
string g = bbW;
if (node["Weighting"].InnerText == Weighting.Text)
{
node["BBWeightin g"].InnerText = g;
}
}
xmlDocument.Sav e(Server.MapPat h("WT.xml"));
xmlDocument = null;
}
Comment