首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

关于URL路径的有关问题

2012-02-15 
关于URL路径的问题 - Web 开发 / Ajax兄弟正在使用ASP.NET MVC 2 做一个小的项目,前台使用的是Ext Js, 结

关于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"
这个地方用绝对路径不可能不行呀。

热点排行