Correct optional route parameters on browsing url

◇◆丶佛笑我妖孽 提交于 2019-12-02 07:59:47

This is referred to as a 'slug' and is typically handled in an action filter. Phil Haack has a good article Manipulating Action Method Parameters that explains it in detail. The basic concept is to handle the filters OnActionExecuting method to extract the route value for the ID parameter, then look up the corresponding name from the database and add that value to the Name parameter.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!