mvc3 Routes setup as id, id2 id3

前端 未结 1 1125
[愿得一人]
[愿得一人] 2021-01-16 05:00

I have the following area routes setup.

context.MapRoute(
    \"Admin_default3\",
    \"Admin/{controller}/{action}/{id}/{id2}/{id3}\",
    new { action = \"         


        
相关标签:
1条回答
  • 2021-01-16 05:38

    I would create more routes. That way, you have things like:

    Html.ActionLink(title, "Action", "Controller", new { source = <value>, daysOld = <value>, includeNonEnglish = <value> });
    

    Instead of:

    Html.ActionLink(title, "Action", "Controller", new { id = <value>, id2 = <value>, id3 = <value> });
    

    Among other things (like AJAX calls with jQuery, where you use Json for specifying parameters). It would make things more readable. It would also help if you're using, or going to use, T4MVC.

    0 讨论(0)
提交回复
热议问题