TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kaushal mani raikwar
NA
55
1.3k
Have a problem to get data slow on view from controller.
Sep 20 2015 11:08 AM
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.
<script>
$.ajax({
type: 'POST', // POST GET
dataType: 'json',
url: '/Result/getFlightData',
data: { id: '67', name: 'Deepak' },
success: function (Data)
{
create_resultList(Data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
// error code
}
});
</script>
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);
}
Reply
Answers (
1
)
Page index changing for double bindings
What is the use of IS and AS in C#