If I store the contents of an xml file (name -> value) in a session collection, whats the best way of accessing it on another page (i.e not the one that the below script runs on).
Is it just a job of creating a new instance of SessionStateItemCollection on each page I want to access the collection?
System.Xml.XmlDocument oXmlDoc = new System.Xml.XmlDocument();
oXmlDoc.Load(Server.MapPath("xml.xml")); //load XML file
XmlNode root = oXmlDoc.DocumentElement;
SessionStateItemCollection PSess = new SessionStateItemCollection(); //session collection
for (int x = 0; x < root.ChildNodes.Count; x++) //loop through children and add to session
{
PSess[root.ChildNodes.Item(x).Name] = root.ChildNodes.Item(x).InnerText; //add xml values to session
}
Thanks (as you can guess I'm only just delving into allthis)