Generating Route Url to MVC controller action from WebAPI

前端 未结 1 1240
死守一世寂寞
死守一世寂寞 2020-12-10 11:15

I\'m used to generating route URLs to other controller actions within an MVC controller action using something similar to below:

public class ApplicationCont         


        
相关标签:
1条回答
  • 2020-12-10 11:32

    You can use MVC route names as well with web API UrlHelper. Example,

     Url.Link("Default", new { Controller = "Account", Action = "Login" });
    

    or

     Url.Route("Default", new { Controller = "Account", Action = "Login" });
    
    0 讨论(0)
提交回复
热议问题