如何在@ Html.partial中传递变量

时间:2019-10-25 07:44:53

标签: jquery asp.net-mvc model-view-controller

如何在@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;
                }
            }]
        });

Reference Image

0 个答案:

没有答案