首页 新闻 赞助 找找看

这条路由规则怎么创建controller 和 action

0
悬赏园豆:5 [已解决问题] 解决于 2014-02-24 10:31

routes.MapRoute(
            name: "Null Default",
            url: "{controller}/{id}/{action}"
                );

生活还是要继续的主页 生活还是要继续 | 初学一级 | 园豆:10
提问于:2014-02-22 17:59
< >
分享
最佳答案
0
public class TestController : Controller
{
    public ActionResult YourAction(int Id)
    {
    }
}
收获园豆:3
dudu | 高人七级 |园豆:31075 | 2014-02-22 21:43

public ActionResult YourAction()

{

      RedirectToAction("Action", "Controller", new { id = 1 });

}

生活还是要继续 | 园豆:10 (初学一级) | 2014-02-24 10:30
其他回答(1)
0

你这是默认路由,Controller,Action用系统自动创建的就行。

收获园豆:2
幻天芒 | 园豆:37175 (高人七级) | 2014-02-24 10:05
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册