Fix #522, [MusicStore]: Html.BeginForm() while generating the action url

should consider the application base path
- `request.BasePath` was indeed ignored
- also simplify `formAction` calculation using the higher-level
  `PathString.Add()` overloads
This commit is contained in:
dougbu 2014-05-11 22:31:28 -07:00
parent db3cdfb97a
commit 37b2bf4997
1 changed files with 1 additions and 13 deletions

View File

@ -769,19 +769,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
// parameters. Also reachable in the even-more-unusual case that user called another BeginForm()
// overload with default argument values.
var request = ViewContext.HttpContext.Request;
if (request.Path.HasValue)
{
formAction = request.Path.Value;
}
else
{
formAction = string.Empty;
}
if (request.QueryString.HasValue)
{
formAction += request.QueryString.Value;
}
formAction = request.PathBase.Add(request.Path).Add(request.QueryString);
}
else
{