title: .NET - Dynamically get Web Root URL of another project
body: <p>I have 4 WebForms projects in my solution. I want to be able to do URL redirects to a page in another WebForms project.</p>
  
  <p>Currently I have to set a URL/port number in my project web settings, set that URL in my web config as an app setting, then read it and handle redirecting.</p>
  
  <p>This is a real pain and makes deployments to various environments obnoxious. Is there a way to dynamically handle this via code?</p>
  
  <p>To make the above even more complication I may have all projects mapped in IIS as such:</p>
  
  <ul>
  <li>www.mydomain.com/project1</li>
  <li>www.mydomain.com/test/project2</li>
  <li>www.mydomain.com/test/project3</li>
  </ul>
  
  <p>But, that shouldn't matter because you can do this to get the Web Root Url for the server that I want to redirect to:</p>
  
  <pre><code>HttpContext.Current.Request.ApplicationPath;
  </code></pre>
  
  <p>I am not sure if just handling the web config route is my best option or if I can do this dynamically?</p>
  
  <p>Thanks for any assistance.</p>