System.Configuration.ConfigXmlDocument xml1 = new System.Configuration.ConfigXmlDocument(); xml1.Load(Server.MapPath("web.config")); XmlNodeList xmlele = xml1.GetElementsByTagName("sessionState"); foreach(XmlAttribute xmlattr in xmlele.Item(0).Attributes) { if(xmlattr.Name == "timeout") { Response.Write(xmlattr.Value); } }