私は次のjquery関数を持っています:
function SaveMail() {
subject = $("#MailMsgSubject").val();
message = $("#MailMsgMessage").val();
to = To;
cc = Cc;
$.ajax({
type: "POST",
data: JSON.stringify({ subject: subject, message: message, listTo: to, listCc: cc }),
url: '@Url.Action("SaveNewMail", "Mail")',
contentType: "application/json; charset=utf-8",
success: function (data) {
$("#SuccesDiv").html("<b>Your message has been succesfully sent</b>");
}
});
}
そして、私は次の見解を持っています:
<div style="float: left">
Subject :
</div>
<div style="float: left; width: 30.5%">
@Html.TextBoxFor(modelItem => Model.Subject, new { id = "MailMsgSubject", @style = "width:99%" })
</div>
<div style="clear: both" />
<div style="float: left">
Priority :@Html.EditorFor(modelItem => Model.Priority, new { id = "MailMsgPriority" })
</div>
<div style="float: left">
Return Receipt :@Html.EditorFor(modelItem => Model.ReturnReceipt, new { id = "MailMsgRR" })
</div>
<div style="float: left">
Patient :@Html.TextBoxFor(modelItem => Model.Priority, new { id = "MailMsgPatient" })
</div>
<div style="clear: both" />
<div style="float: left">
Message :
</div>
<div style="clear: both" />
<div style="float: left; width: 35%">
@Html.TextBoxFor(modelItem => Model.Message, new { id = "MailMsgMessage", @style = "height: 220px; width:100%" })
</div>
<p style="text-align: right">
<input type="button" id="btnSaveMailMessage" />
</p>
私の問題は、ここにある 2 つのチェックボックス (Priority と Return Receipt) の値を JQuery 関数に渡すことです。EditorFor 私が最近発見したように (難しい方法)、セット ID の受け入れに問題があります
。解決策はありますか? 前もって感謝します !
これらの値をコントローラーメソッド「SaveNewMail」と呼ばれるAjaxに渡すにはどうすればよいですか