Getting Absolute URL fron an ASP.NET MVC Action

后端 未结 7 589
北恋
北恋 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:39

    You have a few options:

    • Save the value of HttpContext.Request.Url in a static or member variable, and use that to pass the Fully-qualified path.
    • Save the app domain in an app setting in the web.config.
    • Hard-code the value.
    0 讨论(0)
提交回复
热议问题