Hi all,
I have a problem in my mvc application. i have a xml file that have a xml data to display record on result view.
Problem is that when i call a getFlightData method of c# class from javascript function, but if response xml file have 40- 50 record then this script function get
json data very fast from getFlightData method of c# class but if response xml file have 200-300 record then script function get json data very slow 10-15 second from getFlightData method of c# class. this problem is happen when application run on server.
plz suggest me how i can perform this task in fast way. Thanks in advance
Result.chtml file.
ResultController.cs file
public string getFlightData(string id, string name)
{
filePath = Server.MapPath(@"~\App_Data\Result\SF" + Session.SessionID + ".xml"); // dynamic
filePath = System.IO.File.ReadAllText(filePath);
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(filePath);
return JsonConvert.SerializeObject(xdoc);
}
{
filePath = Server.MapPath(@"~\App_Data\Result\SF" + Session.SessionID + ".xml"); // dynamic
filePath = System.IO.File.ReadAllText(filePath);
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(filePath);
return JsonConvert.SerializeObject(xdoc);
}

Francis SusaimichaelPosted Sep 20, 2015, 7:30 PM