Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 22, 2012 01:11 AM by Decker Dong - MSFT
Member
16 Points
37 Posts
Feb 20, 2012 12:10 AM|LINK
System.Xml.XmlNodeList list = Doc.SelectNodes("root/Address/field"); foreach (System.Xml.XmlNode item in list) { //addressfields.Add(item.InnerText); System.Web.HttpContext.Current.Response.Write(item.InnerText); }
when i add det item.InnerText to the list it simply return null, but when i do a Respone.Write the output is the text of the node.
I cant find the reason why.
Thanks for the help
XmlNodeList xmlNode list
Contributor
3051 Points
714 Posts
Feb 20, 2012 02:47 AM|LINK
Hi MatiasKorn,
What is this "addressfields" object here ? Is this arrayList ? Well, this should add values to the list. You can try two things here :
1. try to set some breakpoint for checking what value you are gettinh for "item.InnerText" ?
2. May be "addressfields" object is re initializing again. So try to check out that point too.
Thanks..
All-Star
118619 Points
18779 Posts
Feb 22, 2012 01:11 AM|LINK
Hello MatiasKorn:)
If your problem cannot be solved,please show us your xml contents。
Regaurds!
MatiasKorn
Member
16 Points
37 Posts
XmlNode.InnerText
Feb 20, 2012 12:10 AM|LINK
System.Xml.XmlNodeList list = Doc.SelectNodes("root/Address/field");
foreach (System.Xml.XmlNode item in list)
{
//addressfields.Add(item.InnerText);
System.Web.HttpContext.Current.Response.Write(item.InnerText);
}
when i add det item.InnerText to the list it simply return null, but when i do a Respone.Write the output is the text of the node.
I cant find the reason why.
Thanks for the help
XmlNodeList xmlNode list
kuber.manral
Contributor
3051 Points
714 Posts
Re: XmlNode.InnerText
Feb 20, 2012 02:47 AM|LINK
Hi MatiasKorn,
What is this "addressfields" object here ? Is this arrayList ? Well, this should add values to the list. You can try two things here :
1. try to set some breakpoint for checking what value you are gettinh for "item.InnerText" ?
2. May be "addressfields" object is re initializing again. So try to check out that point too.
Thanks..
Visit My Blog
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: XmlNode.InnerText
Feb 22, 2012 01:11 AM|LINK
Hello MatiasKorn:)
If your problem cannot be solved,please show us your xml contents。
Regaurds!