<?xml version="1.0" encoding="utf-8"?> <Interests> <Interest> <ID>1</ID> <Name>dance</Name> </Interest> <Interest> <ID>2</ID> <Name>Entertainment</Name> </Interest> <Interest> <ID>3</ID> <Name>Tours</Name> </Interest> </Interests>
string strBaseDirectory = AppDomain.CurrentDomain.BaseDirectory; string strFullPath = strBaseDirectory + "Interest.xml"; string strid = Request.QueryString["Drop"]; XElement xe = XElement.Load(strFullPath); var name = from Name in xe.Elements("Interest") where (string)Name.Element("ID").Value == strid select Name.Value; Label1.Text = name.Last().ToString();
var name = from interest in xe.Elements("Interest") where (string)interest.Element("ID") == strid select (string)interest.Element("Name");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)