﻿function GetEditorContent() {
    $.ajax({
        type: "POST",
        url: "Assets/Services/AdminServices.asmx/GetContent",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        data: "{}",
        async: true,
        success: function(msg) {
            CKEDITOR.instances.editor1.setData(msg.d);
        },
        failure: function(msg) {
            CKEDITOR.instances.editor1.setData('Oops something is wrong... please contact support!');
        }
    });
}

function UpdateContent() {
    var Params = { "content":CKEDITOR.instances.editor1.getData() };
    var jQueryParams = JSON.stringify(Params);

    $.ajax({
        type: "POST",
        url: "Assets/Services/AdminServices.asmx/UpdateContent",
        data: jQueryParams,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        async: false,
        success: function(msg) {
            window.location = "Default.aspx";
        },
        failure: function(msg) {

        }
    });

}
