I'm using VB.Net and MVC 5. I have a an object I am creating with javaScript like this:
var myEdits = {
listOfIDs: [],
listOfValues : []
};
I need to send this object to my controller and move on to the next view with the information it contains.
I can successfully stringify the object and pass it to the controller via ajax, and manipulate the data, but this does not allow me to render the new view on success.
I tried to use window.location and endodeURIComponent like this:
myEdits = encodeURIComponent(JSON.stringify(myEdits));
var postString = ("/ViewDetails/EditConfirmation/" + myEdits);
window.location = postString;
But I receive this error still:
A potentially dangerous Request.Path value was detected from the client (:).
Which I find odd, because I cannot see any :'s in the request:
EditConfirmation/%7B"listOfIDs"%3A%5B"22"%2C"23"%2C"24"%2C"25"%2C"26"%2C"27"%2C"28"%2C"29"%2C"30"%2C"31"%2C"32"%2C"33"%2C"34"%2C"35"%2C"36"%5D%2C"listOfValues"%3A%5B""%2C""%2C""%2C""%2C""%2C""%2C""%2C""%2C""%2C""%2C"Yes"%2C"Yes"%2C"Yes"%2C"Yes"%2C"No"%5D%7D
What is the proper way to pass this object via javaScript or jQuery to the controller, and have the server render the new view?