博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ASP-NET-4-URL-Routing-Default-Page
阅读量:4967 次
发布时间:2019-06-12

本文共 877 字,大约阅读时间需要 2 分钟。

转自:http://blog.ysatech.com/post/2010/07/11/ASP-NET-4-URL-Routing-Default-Page.aspx

Problem

I was implementing ASP.NET routing features for one of the web application. The code was working correctly in the development environment. Then I deployed it to staging server, navigate to http://mydomain.com/ and received the error 

"404 File Not Found". 
I tried to include routes.MapPageRoute("Default", "/", "~/Default.aspx"); in the global.asax file but I received another error 
"The route URL cannot start with a '/' or '~' character and it cannot contain a '?' character.Parameter name: routeUrl".
After several trials and errors, I found out that we should leave the "URL with parameters" empty. See below. 
routes.MapPageRoute("Default", "", "~/Default.aspx"); 
I hope you all will find this information useful.

转载于:https://www.cnblogs.com/daoxuebao/archive/2012/05/04/2482300.html

你可能感兴趣的文章
BZOJ1026: [SCOI2009]windy数
查看>>
样板操作数
查看>>
64位UBUNTU下安装adobe reader后无法启动
查看>>
组件:slot插槽
查看>>
Nginx配置文件nginx.conf中文详解(转)
查看>>
POJ 1308 Is It A Tree?(并查集)
查看>>
N进制到M进制的转换问题
查看>>
利用sed把一行的文本文件改成每句一行
查看>>
Android应用开发:核心技术解析与最佳实践pdf
查看>>
python——爬虫
查看>>
孤荷凌寒自学python第五十八天成功使用python来连接上远端MongoDb数据库
查看>>
求一个字符串中最长回文子串的长度(承接上一个题目)
查看>>
简单权限管理系统原理浅析
查看>>
springIOC第一个课堂案例的实现
查看>>
求输入成绩的平均分
查看>>
php PDO (转载)
查看>>
wordpress自动截取文章摘要代码
查看>>
[置顶] 一名优秀的程序设计师是如何管理知识的?
查看>>
scanf和gets
查看>>
highcharts 图表实例
查看>>