Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Add FormTagHelper. #1323

Closed
wants to merge 1 commit into from
Closed

Conversation

NTaylorMullen
Copy link

@NTaylorMullen NTaylorMullen changed the title Add FormTagHelper. [Design] Add FormTagHelper. Oct 10, 2014
private ViewContext ViewContext { get; set; }

[Activate]
private AntiForgery AntiForgery { get; set; }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and its only call site will go away once the method for the antiforgery piece comes in.

@dougbu
Copy link
Contributor

dougbu commented Oct 10, 2014

@NTaylorMullen
Copy link
Author

Addressed code review comments.

@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_CopyHelpers branch from 3b4fe50 to b1918ba Compare October 10, 2014 23:39
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_Form branch 2 times, most recently from c908f03 to 14cf681 Compare October 13, 2014 06:26
@NTaylorMullen NTaylorMullen changed the title [Design] Add FormTagHelper. Add FormTagHelper. Oct 13, 2014
@NTaylorMullen
Copy link
Author

Added tests.

/// <summary>
/// The HTTP method for processing the form, either GET or POST.
/// </summary>
public string Method { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be cleaner not to bind this attribute. just pass the default (FormMethod.Get.ToString()) to the generator. if the user has written this attribute, the copies will automatically leave that alone.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... after offline discussion, let's not make this one different from other HTML attributes we could / do bind

}

// If the anti-forgery token was not specified then don't assume that it's on (user is using the
// FormTagHelper like a normal <form> tag).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rephrase parenthetical comment. user doesn't intend to use this tag helper at all.

@dougbu
Copy link
Contributor

dougbu commented Oct 15, 2014

@NTaylorMullen
Copy link
Author

Addressed code review comments.


if (AntiForgery ?? antiForgeryDefault)
{
var antiForgeryTag = Generator.GenerateAntiForgery(ViewContext);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: antiTagBuilder 😸

@dougbu
Copy link
Contributor

dougbu commented Oct 15, 2014

:shipit:

@NTaylorMullen
Copy link
Author

Will get in once previous PR's in the chain are in

- Added the FormTagHelper.
- Utilized the IHtmlGenerator to share base functionality with the HTMLHelper counterparts.
- Added tests to validate FormTagHelper functionality.

#1246
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_CopyHelpers branch from e127da2 to b7a38c3 Compare October 16, 2014 00:34
@NTaylorMullen NTaylorMullen deleted the TagHelpers_Form branch October 16, 2014 00:38
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants