无法找到该资源。在MVC中使用.attr jquery获取资源错误

时间:2015-04-22 08:21:43

标签: jquery asp.net asp.net-mvc

我正在开发一个MVC网站,导致与资源路径相关的问题。

我之前使用的是Localhost路径,但现在我正在使用Route查看所有视图。现在一切正常,但我遇到设置报告路径的问题。

显示报告

此按钮位于View InvoiceReport上。这就是功能。

function ShowReport() {

  if ($('#InvoiceID').val() == '') {
        alert("Please search the record and then select grid row");
        return;
    }
    else if ($('#InvoiceID').val() == '0') {
        alert("Please search the record and then select grid row");
        return;
    }
    else {
        ShowLoading();
        $('#frameReport').attr('src',"Report.aspx?InvoiceID=" + $('#InvoiceID').val());
        $('#divframe').show();
        selectTab1(2);
        HideLoading();
    }

}

元素frameReport是一个iframe,如下所示:

<div id="divframe" 
   style="padding: 40px 40px 40px 110px; float: left; margin-top: 30px;
   display: none"
> 
  <iframe id="frameReport" src="" width="900px" height="940px"></iframe>
</div>

该报告是一个正常的.aspx页面,位于此视图之外。当我刚刚使用localhost://等相对路径时,它工作得更早。

但现在当我点击“报告”按钮时,它保留在同一条路径上。

http://192.168.1.100/InvoiceReport/Index

但它应该需要重定向到我传入的网址.attr。

 Report.aspx?InvoiceID='123'

请提出您的建议。

由于

0 个答案:

没有答案
相关问题