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

Commit 5d5bb00

Browse files
dougbuNTaylorMullen
authored and
NTaylorMullen
committed
Add IHtmlGenerator and its default implementation
- part of #1243 (kind-of) - mostly copied from `HtmlHelper` but refactored to - consistently take a `ViewContext` parameter and return a `TagBuilder` - provide `GenerateActionLink()` and `GenerateRouteLink()` - provide a separate `GenerateHiddenForCheckBox()`, allowing `GenerateCheckBox()` to return a `TagBuilder` - `GenerateForm()`'s `method` parameter is a `string`, not `FormMethod` nits: format document, consistent line wrapping, variable name changes, ...
1 parent 93de171 commit 5d5bb00

File tree

4 files changed

+1245
-3
lines changed

4 files changed

+1245
-3
lines changed

src/Microsoft.AspNet.Mvc.Core/AntiForgery/AntiForgery.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public AntiForgery([NotNull] IClaimUidExtractor claimUidExtractor,
4242
/// This method has a side effect:
4343
/// A response cookie is set if there is no valid cookie associated with the request.
4444
/// </remarks>
45-
public HtmlString GetHtml([NotNull] HttpContext context)
45+
public TagBuilder GetHtml([NotNull] HttpContext context)
4646
{
4747
var builder = _worker.GetFormInputElement(context);
48-
return builder.ToHtmlString(TagRenderMode.SelfClosing);
48+
return builder;
4949
}
5050

5151
/// <summary>

0 commit comments

Comments
 (0)