Your problem is here:
xmlDoc = HttpContext.Current.Application["xmlDoc"];
Try
xmlDoc = HttpContext.Current.Application["xmlDoc"] as System.Xml.XmlDocument;
Moron
2010-02-09 07:30:53
Your problem is here:
xmlDoc = HttpContext.Current.Application["xmlDoc"];
Try
xmlDoc = HttpContext.Current.Application["xmlDoc"] as System.Xml.XmlDocument;
Got the answer after a little googling, a simple one but can be tricky for a PHP developer working on C# (as it was in my case) well i just had to explicitly cast my application state variable to XmlDocument that is at place of :
XmlDocument xmlDoc = new XmlDocument();
xmlDoc = HttpContext.Current.Application["xmlDoc"];
I used :
XmlDocument xmlDoc = new XmlDocument();
xmlDoc = (XmlDocument) HttpContext.Current.Application["xmlDoc"];
and it becomes Robust :)
can any one tell me what will be the lifetime of this ApplicationState Variable ?