【发布时间】:2011-04-01 04:44:14
【问题描述】:
我已经使用以下路由在 ASP.NET 4.0 中实现了 URL 路由。
routes.MapPageRoute(
"NewsDetails", // Route name
"news/{i}/{*n}", // Route URL
"~/newsdetails.aspx" // Web page to handle route
);
这给了我像
这样的网址http://www.mysie.com/news/1/this-is-test-news
这在我的本地主机上运行良好。
但是当我将它上传到服务器时,它给出了...
Server Error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed,
or is temporarily unavailable.
如果我尝试http://www.mysie.com/news/1/this-is-test-news.aspx,那么它会显示页面。
有人遇到同样的问题吗?
如何设置网址 http://www.mysie.com/news/1/this-is-test-news 在 windows server 2008 上工作?
【问题讨论】:
-
该路由的文件是否与aspx页面在同一目录下?
-
没有。我的 aspx 文件位于根文件夹
标签: routing asp.net-4.0