From 37b2bf4997bb4e4bf14af4ec56d60ba930734b7e Mon Sep 17 00:00:00 2001 From: dougbu Date: Sun, 11 May 2014 22:31:28 -0700 Subject: [PATCH] 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 --- .../Rendering/Html/HtmlHelper.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs b/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs index 4d30164d31..f6da54c482 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs @@ -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 {