Getting Absolute URL fron an ASP.NET MVC Action

后端 未结 7 613
北恋
北恋 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:16

    The built-in helpers in MVC 4 create absolute URLs if either the host or protocol parameters are non-empty. See this answer here with an example extension method for use in views.

提交回复
热议问题