The path from which the ASP.NET application is launched

The ASP.NET application sends HTML emails with links to external images. These images are placed in the same folder where the application is deployed. Therefore, before sending, it changes the email template so that the links are correct.

Now I am using

new UriBuilder(Request.Url.Scheme, Request.Url.Host, 
    Request.Url.Port, ResolveUrl("~")).ToString()

      

to get the path from where the application is running, but I want something to be simpler.

Some of the answers to this related question were helpful, but I'm still hoping for a better solution.

Thank!

+1


source to share


1 answer


Request.ApplicationPath?



+3


source







All Articles