c# - 在 asp.net mvc 中打开 .aspx 文件作为 cshtml 的部分 View

标签 c# jquery asp.net-mvc reportviewer

我尝试在我的 MVC 应用程序中使用 ReportViewer。

我有一个有按钮的 View :

<button id="ReprintBol" class="button secondary right noPrint" style="display: inline-block; position: absolute; bottom: 0; right: 0">
    <span class="noPrint" style="display: inline-block; padding: 0 0 0 10px; font-size: 11px; font-weight: bold;">Reprint</span>
</button>

作为局部 View 的 Aspx 文件:

@Html.Partial("ReportViewer")

处理按钮点击的代码:

<script>

$('#ReprintBol').click(function () {
    $("#Test").dialog({
        bgiframe: true,
        resizable: false,
        width: 700,
        height: 400,
        modal: true,
        title: 'Note',
        autoOpen: false,
        draggable: true,
        show: "blind",
        hide: "blind",
        bDestroy: true,
        overlay: {
            backgroundColor: '#000',
            opacity: 0.5
        },
    });
    $("#Test").dialog("option", "title", "Select Stops");
    $("#Test").dialog("open");
});

</script>

我的aspx View

<div id="Test" style="display: none">

   <form id="form1" runat="server">
       <asp:ScriptManager ID="ScriptManager1" runat="server">
 </asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="509px" Width="1542px">
</rsweb:ReportViewer>
</form> 
</div>

当我尝试运行这段代码并点击按钮时,只是错误显示并说 javascript 有错误。我已经检查了 10 次,但没有看到任何内容。 我做错了什么?

谢谢

最佳答案

似乎在这个 block 的末尾有额外的“,”:

$("#Test").dialog({
        bgiframe: true,
        resizable: false,
        width: 700,
        height: 400,
        modal: true,
        title: 'Note',
        autoOpen: false,
        draggable: true,
        show: "blind",
        hide: "blind",
        bDestroy: true,
        overlay: {
            backgroundColor: '#000',
            opacity: 0.5
        }**,**
    });

同时将类型添加到脚本标签中,如下所示:

<script type="text/javascript" >

关于c# - 在 asp.net mvc 中打开 .aspx 文件作为 cshtml 的部分 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35914254/

相关文章:

javascript - 如何允许选择禁止选择的帖子上的某些文本?

C# MySQL 执行 UPDATE 什么都不做

c# - 如何在 Mac 上的 Monodevelop 中将单文件程序转换为 .exe

c# - 我是否需要自己在 xamarin.forms 中清理内存?

asp.net-mvc - ASP.NET MVC : how to add nested property to Modelstate?

asp.net-mvc - Telerik MVC Grid,真正的 Ajax 自定义绑定(bind)

asp.net-mvc - 仅在 ASP.NET MVC 中缓存母版页

c# - 流媒体编程

javascript - 使用 jquery 和 css 如何创建延迟的背景颜色变化动画?

javascript - jQuery add() 替代性能