Alright. I can get the HTML I need from the page (it's all in a DIV). That's not the problem. What I need to do is take the HTML and pass it, via a C# class into a controller.
I tried doing something like this with knockout/jQuery:
var Details = $("#Details").html();
console.log(Details);
DetailsPdf.DetailsMarkup = JSON.stringify(Details);
var jsonData = ko.toJS(Details);
ko.utils.postJson("/MyController/MyAction", DetailsPdf);
The knockout actually DOES get me the relevant HTML. But when I pass it to my class, I get an exception that reads:
A potentially dangerous Request.Form value was detected from the client.
Then it partially shows the HTML I was sending as a part of the exception. I can't even seem to pass in the entities themselves without getting that exception.
This is an app with certain company-mandated security features, so turning off validation is not an option.
I need the HTML, or at least a way to re-create it on the server in the C#.
I'm still fairly new to knockout. Does anyone have any suggestions here?