I'm working on a Asp.net MVC application. In my project, I'm using a third party JavaScript library called Dhtmlx Scheduler.
There is a function in this library then writes all the data on the scheduler into XML format.
I then need to manipulate this data, and write in back onto a <textarea>
on my view page.
as of now this is what I have:
View:
function save() {
var url = "/Home/Save"
var xml = scheduler.toXML();
$.ajax({
url: url,
Type: "POST",
dataType: 'json',
async: false,
data: { xmlString: xml },
contentType: 'application/json; charset=utf-8',
success: alert("File Saved in C:\\ Drive as Tasks.xml")
});
}
Controller:
public ActionResult Save(string xmlString)
{
XmlDocument doc = new XmlDocument();
try
{
doc.LoadXml(xmlString);
}
catch(Exception e)
{
Console.WriteLine(e);
}
doc.Save(@"C:\\Tasks.xml");
W6ViewModel viewModel = new W6ViewModel();
viewModel.engineers = db.W6ENGINEERS.ToList();
viewModel.tasks = db.W6TASKS.ToList();
viewModel.skills = db.W6TASKS_REQUIRED_SKILLS1.ToList();
viewModel.categories = db.W6TASKTYPECATEGORY.ToList();
gatherInfo(viewModel);
return View("Index", viewModel);
}
When trying to save three events (Dhtmlx objects) it works flawlessly, when trying to add more data to the XML I get this error (read form FireBug):
The length of the query string for this request exceeds the configured maxQueryStringLength value.
Any help would be greatly appreciated. Thanks!
Firebug Console: