i wanna fetch UseId 3 on page...i tried this code but it's not working.
XDocument xmlDoc = XDocument.Load(xmlfile);
int i = 0;
i = xmlDoc.ChildNodes(0).LastChild.Attributes("UserId").Value;
ANyone has idea??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
AnkurRank #1,353 · 1.2K reputationPosted Oct 28, 2010, 3:56 AM EDT
please try this, hope it would be helpful (tried in WPF).
string userId = XDocument.Load(xmlFile).Element("Users").Elements("User").Last().Attribute("UserId").Value;
Thanks and Regards
ankur malik
Raj KumarRank #25 · 44.2K reputationPosted Oct 28, 2010, 8:01 PM EDT