Getting Absolute URL fron an ASP.NET MVC Action

后端 未结 7 630
北恋
北恋 2020-12-07 19:37

This probably is a dummy question but I cannot find a clear indication. I have a POCO class in a MVC3 web application whose only purpose is managing the backup of some files

7条回答
  •  长情又很酷
    2020-12-07 20:23

    In ASP.Net Core 2.0 (MVC) this works to create an absolute url to an action.

    var url = Url.Action("About", "Home", new { /*Route values here*/ }, Request.Scheme);
    

提交回复
热议问题