Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created December 9, 2015 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/9f5a7e0a86e3d864014b to your computer and use it in GitHub Desktop.
Save bjoerntx/9f5a7e0a86e3d864014b to your computer and use it in GitHub Desktop.
function SaveToController(DocumentName) {
TXTextControl.saveDocument(TXTextControl.streamType.InternalUnicodeFormat,
function (e) {
var serviceURL = "/Home/SaveTemplate";
$.ajax({
type: "POST",
url: serviceURL,
contentType: 'application/json',
data: JSON.stringify({
DocumentName: DocumentName,
BinaryDocument: e.data
}),
success: successFunc,
error: errorFunc
});
function successFunc(data, status) {
alert("Document has been saved successfully.");
}
function errorFunc() {
alert('Error');
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment