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:
parent
db3cdfb97a
commit
37b2bf4997
|
|
@ -769,19 +769,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
// parameters. Also reachable in the even-more-unusual case that user called another BeginForm()
|
// parameters. Also reachable in the even-more-unusual case that user called another BeginForm()
|
||||||
// overload with default argument values.
|
// overload with default argument values.
|
||||||
var request = ViewContext.HttpContext.Request;
|
var request = ViewContext.HttpContext.Request;
|
||||||
if (request.Path.HasValue)
|
formAction = request.PathBase.Add(request.Path).Add(request.QueryString);
|
||||||
{
|
|
||||||
formAction = request.Path.Value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
formAction = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.QueryString.HasValue)
|
|
||||||
{
|
|
||||||
formAction += request.QueryString.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue