2
jqueryを使用して、コントローラにHTMLマークアップを渡す必要があります(detalle変数を参照してください)。 デタールを送信するには、それが見つかりませんでした、誰かが私を助けることができると言いましたか?javascriptからasp.net mvcコントローラへのパラメータとしてHTMLを送信
$('#BtnPrint').click(function() {
var detalle = "<br><br>";
detalle += " Yo: <b>" + '@Model.DoctorText' + "</b>";
if ('@Model.Exequartur' != "") {
detalle += ", exequatur: <b>" + '@Model.Exequartur' + "</b> <br>";
}
detalle += " certifico haber examinado a: <b>" + '@Model.PatientName' + "</b> <br>";
@*if (@Model.ide != "")
{
detalle += " cedula: <b>" + txtcedula.Text + "</b> <br>";
}*@
detalle += " quien presenta: <b>" + '@Model.Affections' + "</b> <br>";
detalle += " por lo que recomiendo: <b>" + '@Model.Recomendations' + "</b> <br>";
detalle += "<br> dado en: <b>" + ' @Model.Place' + "</b>, " + '@Model.MedicalCertificateDate' +
" <br>";
detalle += "<br><br><br><br> ";
$('#myVar').val(detalle);
var win = window.open(
"@Url.Action("DetailsPrint", "Reports", new {area = "Configurations", id = @Model.Patient.Person.AuthorId, body = detalle, description = "Certificado Medico"})") ;
//// var win = window.open('http://stackoverflow.com/', '_blank');
if (win) {
//Browser has allowed it to be opened
win.focus();
} else {
//Browser has blocked it
alert("Porfavor, debes permitir que se abran las ventanas emergentes o el reporte no va a salir :'(");
}
});
ときI試してみて、このエラーを投げてください 'http:// localhost:13076/Medicals/Patients/DetailsMedicalCertificates/1 \ n \ nSの行402の43行目のJavaScript重大エラーCRIPT5017:正規表現で構文エラーが発生しました。 ' – sGermosen
私の答えは –
ですが、問題は解決しましたが、今は別のビューがHTML上に表示されていません。 ビューは、この *
ヨのように表示されます。ペペ、exequatur:
certificoのハーバーはexaminado:ララ * これはあなたが必要なビュー '