1

我正在使用 Visual Studio 中的页面检查器调试器来完成有关如何使用 jQuery 显示显示一行文本和下拉列表的对话框的教程。

在 Page Inspector 中,它出现在元素周围的 random , 标签,如图所示

在此处输入图像描述

在 Chrome、IE 等中调试时不会发生这种情况

在此处输入图像描述

以前有没有其他人经历过这种情况,或者知道为什么会发生这种情况。这只是一个“功能”还是页面检查器?

用于生成此弹出窗口的代码如下...

这通过按下调用该方法btnLookAndFeel的页面上的按钮来工作,该方法返回部分视图ItemEdit.cshtmlListingItemController.EditLookAndFeelEditLookAndFeel.cshtml

ItemEdit.cshtml

@section scripts
{
    <script>
        $(function () {
            $('#btnLookAndFeel').click(function () {
                $.get('/ListingItem/EditLookAndFeel',
                    { id: $('#LookAndFeelId').val() },
                    function (data) { $('#divLookAndFeel').html(data).dialog(); });
            });
        });
    </script>
}

列表项控制器.cs

public ActionResult EditLookAndFeel(int id)
    {
        var list = _lookAndFeelService.List();
        ViewBag.LookAndFeelList = new SelectList(list, "Id", "Name", id);
        return PartialView();
    }

编辑LookAndFeel.cshtml

<div>
    Please select the Look and Feel: @Html.DropDownList("LookAndFeelList") 
</div>
4

0 回答 0