我知道以前有人问过这个问题,我也尝试过使用这些解决方案来解决我的错误,但我无法使用过去类似问题的解决方案。错误消息是它需要一个')‘。我试过添加和删除括号,以及删除单引号和双引号,但每次都会出错?
protected void btnTestCS_Click(object sender, EventArgs e)
{
string result1 = "Failed: The samAccountName IdentityType must be in the form \"domainname\\userName\", \"machinename\\userName\", or \"userName\". | NN-NN-NN-01.NN.NN.NNNNN.NNN | CN=^sharing,OU=xxx_xxxxxx,OU=xxxxx,OU=xxxx,OU=xxx,OU=xxxxx,DC=xx,DC=xx,DC=xxx,DC=xxxxx)";
ScriptManager.RegisterStartupScript(Page, this.GetType(), "errorRunExchangeShellMultiCommandsss", "javascript:showDialogError(" + result1 + ")" , true);
}
function showDialogError(results) {
results = results.replace("'", "\\'");
results = results.replace("\"", "");
$("#dialogFailureText").text(results);
$("#dialogFailure").dialog({
modal: true,
title: 'Something went wrong',
text: results,
buttons: {
OK: function () {
$(this).dialog("close");
}
}
});
}
https://stackoverflow.com/questions/51031878
复制相似问题