This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
FormTagHelper does not apply on Razor Pages unless asp-antiforgery is explicitly set to true #6006
Comments
Let's change the |
The other option is to move antiforgery support into |
@Eilon says: We think that moving this feature ( |
Load balancing |
NTaylorMullen
added a commit
that referenced
this issue
Apr 18, 2017
- Added functional test to validate that non-attributed form tags have an antiforgery input generated. Re-generated baseline to reflect changes. - Added a unit test to validate that parameterless `FormTagHelper`s behave as expected. #6006
NTaylorMullen
added a commit
that referenced
this issue
Apr 19, 2017
- Added functional test to validate that non-attributed form tags have an antiforgery input generated. Re-generated baseline to reflect changes. - Added a unit test to validate that parameterless `FormTagHelper`s behave as expected. #6006
NTaylorMullen
added a commit
that referenced
this issue
Apr 21, 2017
- Added functional test to validate that non-attributed form tags have an antiforgery input generated. Re-generated baseline to reflect changes. - Added a unit test to validate that parameterless `FormTagHelper`s behave as expected. #6006
NTaylorMullen
added a commit
that referenced
this issue
Apr 21, 2017
- Added functional test to validate that non-attributed form tags have an antiforgery input generated. Re-generated baseline to reflect changes. - Added a unit test to validate that parameterless `FormTagHelper`s behave as expected. #6006
NTaylorMullen
added a commit
that referenced
this issue
Apr 25, 2017
- Added functional test to validate that non-attributed form tags have an antiforgery input generated. Re-generated baseline to reflect changes. - Added a unit test to validate that parameterless `FormTagHelper`s behave as expected. #6006
NTaylorMullen
added a commit
that referenced
this issue
Apr 25, 2017
- Added functional test to validate that non-attributed form tags have an antiforgery input generated. Re-generated baseline to reflect changes. - Added a unit test to validate that parameterless `FormTagHelper`s behave as expected. #6006
@Eilon Are we announcing all MVC breaking changes together or do we want to do them as one-offs? |
Generally using one-offs, unless there are closely-related items. |
NTaylorMullen
added a commit
that referenced
this issue
Apr 25, 2017
- Added a test case to the HtmlGeneration functional test (the one verifying complex FormTagHelpers). - Added unit test verifying antiforgery behavior when it's the only provided parameter. #6006
NTaylorMullen
added a commit
that referenced
this issue
Apr 25, 2017
- Added functional test to verify `asp-*` attributes on form taghelpers work as expected. - Added a unit test to validate `FormTagHelper` behaves as expected. - Moved `Method == "get"` checks into appropriate code paths. These include the one where a user specifies an empty or non-existent `action` attribute and where a user doesn't utilize any `asp-*` attributes. In the later, we default `Method` to `"get"` if it's not provided. #6006
NTaylorMullen
added a commit
that referenced
this issue
Apr 25, 2017
- Added functional test to verify `asp-*` attributes on form taghelpers work as expected. - Added a unit test to validate `FormTagHelper` behaves as expected. - Moved `Method == "get"` checks into appropriate code paths. These include the one where a user specifies an empty or non-existent `action` attribute and where a user doesn't utilize any `asp-*` attributes. In the later, we default `Method` to `"get"` if it's not provided. #6006
NTaylorMullen
added a commit
that referenced
this issue
Apr 25, 2017
- Added functional test to verify `asp-*` attributes on form taghelpers work as expected. - Added a unit test to validate `FormTagHelper` behaves as expected. - Moved `Method == "get"` checks into appropriate code paths. These include the one where a user specifies an empty or non-existent `action` attribute and where a user doesn't utilize any `asp-*` attributes. In the later, we default `Method` to `"get"` if it's not provided. #6006
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The
FormTagHelper
only targets<form>
elements if various attributes are present, e.g.asp-controller
. The default behavior of it rendering anti-forgery token fields thus only applies when these attributes are present. When used in Razor Pages however, the normal attributes are not used (as we're posting to another page typically), so the anti-forgery fields are not rendered unless theasp-antiforgery
attribute is explicitly set, which is far less than ideal.We want this to just work in Razor Pages, and it will be much more common there to post back to the current page, meaning no form action will need to be configured.
Shall we just make the
FormTagHelper
target all<form>
elements by default now?@rynowak @Eilon
The text was updated successfully, but these errors were encountered: