Sending multiple parameters to Actions in ASP.NET MVC

后端 未结 3 1050
温柔的废话
温柔的废话 2021-02-05 06:08

I\'d like to send multiple parameters to an action in ASP.NET MVC. I\'d also like the URL to look like this:

http://example.com/products/item/2

3条回答
  •  滥情空心
    2021-02-05 06:39

    you can use any route rule for example:

    {controller}/{action}/{param1}/{param2}
    

    also you can use get params like :baseUrl?param1=1¶m2=2

    and check this link, i hope it will help you.

提交回复
热议问题