如何在@Html.partial
中传递变量?
Index.cshtml
var message = 'select record';
@Html.Partial("_UsermangerMessageBox", message);
_UsermangerMessageBox.cshtml
@model string
$('<div id="umPopup">@Model.ToString()</div>').dialog({
modal: true,
dialogClass: 'dialogue-border deletePopup',
title: "Confirmation",
resizable: false,
open: function () {
$(this).html(message);
},
buttons: [{
text: 'OK',
'class': 'btn btn-primary',
click: function () {
$(this).dialog("close");
return false;
}
}]
});