MVC controller is being called twice

后端 未结 16 647
无人及你
无人及你 2020-11-27 05:15

I have a controller that is being called twice from an ActionLink call.

My home page has a link, that when clicked calls the Index method on the Play controller. An

16条回答
  •  無奈伤痛
    2020-11-27 05:54

    You can also try changing your route to this.

    routes.MapRoute( 
        "Play", // Route name 
        "Play/{id}", // URL with parameters 
        new { controller = "Play", action = "Index" , id = "" } // Parameter defaults 
    );
    

提交回复
热议问题