Purpose of ActionName

后端 未结 6 1615
渐次进展
渐次进展 2020-11-27 03:37

What\'s the benefit of setting an alias for an action method using the \"ActionName\" attribute? I really don\'t see much benefit of it, in providing the user the option to

6条回答
  •  星月不相逢
    2020-11-27 04:03

    Try this code:

    public class ProductsController
     {
    
        [ActionName("create-product")]
        public ActionResult CreateProduct() 
        {
            return View("CreateProduct");
        }
    
    }
    

提交回复
热议问题