title: C# Url.Action parameters - Sub application
body: <p>I am working on sub application related changes in web app. My web application is optimized to run with or without virtual directory. For that, I met with a condition that checked whether the incoming URL is having <strong>"/"</strong> or <strong>"/{subapplicationname}/"</strong></p>
  
  <p>To check this case I made a condition like below,</p>
  
  <p><code>HttpContext.Request.Url.AbsolutePath == Url.Action("/", "/")</code></p>
  
  <p>Without Subapplication: "/" == "/"</p>
  
  <p>With Subapplication: "/applicationname/" == "/applicationname/"</p>
  
  <p>Well actually, both cases (with and without sub application) passed. </p>
  
  <p>And my doubt is whether <code>Url.Action("/", "/")</code> syntax is correct? or else going for HttpRuntime.AppDomainAppVirtualPath is optimal one? </p>
  
  <p>I have searched over internet and didn't find <code>Url.Action("/", "/")</code> scenario.</p>
  
  <p>Any help is appreciated. Thanks in advance.</p>