日期:2014-05-16  浏览次数:20656 次

关于URL路径的问题 - Web 开发 / Ajax
兄弟正在使用ASP.NET MVC 2 做一个小的项目,前台使用的是Ext Js, 结果在引用资源的时候出现了404错误。
Ext代码如下:
JScript code

        var bottom = new Ext.Panel({
            region:'south',
            height:50,
            html:'<iframe scrolling="auto" frameborder="0" height="100%" width="100%" src="Home/bottom.html">'
        });



我想在一个页面的底部插入另一个 bottom.html的页面,结果部署到IIS上之后直接报资源找不到:The resource cannot be found.

可我如果直接使用浏览器打开这个页面的话,没有任何问题,请问这是怎么回事啊? 是和MVC的Route 有关吗?

求各位达人不吝帮助!!!

------解决方案--------------------
路径的写法问题。
你可以直接写绝对路径

var bottom = new Ext.Panel({
region:'south',
height:50,
html:'<iframe scrolling="auto" frameborder="0" height="100%" width="100%" src="/Home/bottom.html"></iframe>'
});

或者
bottom.html与你这个文件直接的相对路径
------解决方案--------------------
src="/Home/bottom.html"
这个地方用绝对路径不可能不行呀。