asp.net mvc routing id parameter

前端 未结 6 881
自闭症患者
自闭症患者 2020-12-29 07:04

I am working on a website in asp.net mvc. I have a route

routes.MapRoute(
    \"Default\", // Route name
    \"{controller}/{action}/{id}\", // URL with pa         


        
6条回答
  •  自闭症患者
    2020-12-29 08:03

    use the bind attribute prefix:

    public ActionResult Customer([Bind(Prefix = "id")]string cname) {}
    

提交回复
热议问题