我正在尝试通过C#和jQuery将HTML页面保存为doc。它正在运行,但是保存后在html上显示的图像未显示doc。这是我的代码:
jQuery代码:
function submit() {
var imageInByte = encodeURIComponent($('#cmpstamp').attr('src'));
$.ajax({
async: false,
type: 'POST',
contentType: "application/json; charset=utf-8",
url: "Agreement.aspx/submitAgreement",
data: JSON.stringify({ AppId: getQueryString("appid"), agreement: $('.word-content').html()),
dataType: 'json',
success: function (data) {
if (data.d == "Success") {
alert(data.d);
}
}
})
}
C#代码:
[WebMethod]
public static string submitAgreement(string agreement, string AppId)
{
using (StreamWriter writer = new StreamWriter(HttpContext.Current.Server.MapPath("~/Documents/ApplicationFile/" + AppId + "/myagreement.doc"), true))
{
string output = agreement + str;
writer.Write(output);
writer.Close();
}
return "";
}