将newslist.aspx?page=* 转换成news/*
MapRoute()辅助方法是重载了的,可以接受2,3,或4个参数(路径名字,URL句法,URL默认参数,URL参数正则表达式约束)。
代码
routes.MapRoute(
"news", "news/{id}",
new { Controller = "news", action = "newslist", id = 1 }, //默认id号为1
new {id=@"[\d]"} //用正则表达式使id号必须为整数
);