繁体   English   中英

打开.aspx文件作为asp.net mvc中cshtml的部分视图

[英]Opening .aspx file as partial view of cshtml in asp.net mvc

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

我有视图有按钮:

<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>

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观点

<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次,没有看到任何。 我做错了什么?

谢谢

看来在这个块的末尾有另外的“,”:

$("#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" >

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM