Hi I am developing an ASP.net web application. I need to find the current location (physical) of the web site (or the bin directory containing the assemblies).
I have t
You need System.Web.HttpRuntime.BinDirectory
(physical path to the bin folder) and System.Web.HttpRuntime.AppDomainAppPath
(physical path to the top-level ASP.NET application folder).
It depends on exactly what you want to do with the path, but the usual approach is Server.MapPath()
. For example:
YourControl.src = Server.MapPath("~/images/image1.jpg");
That will return the physical path for the specified file.