Rename `MvcTagHelpersWebSite` to `HtmlGenerationsWebSite`

- name was too specific and I am about to add another HTML helper scenario
This commit is contained in:
Doug Bunting 2015-06-05 20:30:17 -07:00
parent eefa582069
commit 261975b0bc
95 changed files with 180 additions and 183 deletions

View File

@ -102,7 +102,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CompositeViewEngineWebSite"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ValueProvidersWebSite", "test\WebSites\ValueProvidersWebSite\ValueProvidersWebSite.xproj", "{14F79E79-AE79-48FA-95DE-D794EF4EABB3}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ValueProvidersWebSite", "test\WebSites\ValueProvidersWebSite\ValueProvidersWebSite.xproj", "{14F79E79-AE79-48FA-95DE-D794EF4EABB3}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MvcTagHelpersWebSite", "test\WebSites\MvcTagHelpersWebSite\MvcTagHelpersWebSite.xproj", "{920F8A0E-6F7D-4BBE-84FF-840B89099BE6}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HtmlGenerationWebSite", "test\WebSites\HtmlGenerationWebSite\HtmlGenerationWebSite.xproj", "{920F8A0E-6F7D-4BBE-84FF-840B89099BE6}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ActionResultsWebSite", "test\WebSites\ActionResultsWebSite\ActionResultsWebSite.xproj", "{0A6BB4C0-48D3-4E7F-952B-B8917345E075}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ActionResultsWebSite", "test\WebSites\ActionResultsWebSite\ActionResultsWebSite.xproj", "{0A6BB4C0-48D3-4E7F-952B-B8917345E075}"
EndProject EndProject

View File

@ -9,19 +9,19 @@ using System.Net.Http;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using HtmlGenerationWebSite;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Mvc.TagHelpers; using Microsoft.AspNet.Mvc.TagHelpers;
using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.WebEncoders; using Microsoft.Framework.WebEncoders;
using MvcTagHelpersWebSite;
using Xunit; using Xunit;
namespace Microsoft.AspNet.Mvc.FunctionalTests namespace Microsoft.AspNet.Mvc.FunctionalTests
{ {
public class MvcTagHelpersTest public class HtmlGenerationTest
{ {
private const string SiteName = nameof(MvcTagHelpersWebSite); private const string SiteName = nameof(HtmlGenerationWebSite);
private static readonly Assembly _resourcesAssembly = typeof(MvcTagHelpersTest).GetTypeInfo().Assembly; private static readonly Assembly _resourcesAssembly = typeof(HtmlGenerationTest).GetTypeInfo().Assembly;
private readonly Action<IApplicationBuilder> _app = new Startup().Configure; private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
private readonly Action<IServiceCollection> _configureServices = new Startup().ConfigureServices; private readonly Action<IServiceCollection> _configureServices = new Startup().ConfigureServices;
@ -30,13 +30,13 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
[InlineData("Index", null)] [InlineData("Index", null)]
// Test ability to generate nearly identical HTML with MVC tag and HTML helpers. // Test ability to generate nearly identical HTML with MVC tag and HTML helpers.
// Only attribute order should differ. // Only attribute order should differ.
[InlineData("Order", "/MvcTagHelper_Order/Submit")] [InlineData("Order", "/HtmlGeneration_Order/Submit")]
[InlineData("OrderUsingHtmlHelpers", "/MvcTagHelper_Order/Submit")] [InlineData("OrderUsingHtmlHelpers", "/HtmlGeneration_Order/Submit")]
[InlineData("Product", null)] [InlineData("Product", null)]
[InlineData("Customer", "/Customer/MvcTagHelper_Customer")] [InlineData("Customer", "/Customer/HtmlGeneration_Customer")]
// Testing InputTagHelpers invoked in the partial views // Testing InputTagHelpers invoked in the partial views
[InlineData("ProductList", null)] [InlineData("ProductList", null)]
// Testing MvcTagHelpers invoked in the editor templates with the HTML helpers // Testing MVC tag helpers invoked in the editor templates from HTML helpers
[InlineData("EmployeeList", null)] [InlineData("EmployeeList", null)]
// Testing SelectTagHelper with Html.BeginForm // Testing SelectTagHelper with Html.BeginForm
[InlineData("CreateWarehouse", null)] [InlineData("CreateWarehouse", null)]
@ -52,19 +52,19 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
[InlineData("Image", null)] [InlineData("Image", null)]
// Testing InputTagHelper with File // Testing InputTagHelper with File
[InlineData("Input", null)] [InlineData("Input", null)]
public async Task MvcTagHelpers_GeneratesExpectedResults(string action, string antiForgeryPath) public async Task HtmlGenerationWebSite_GeneratesExpectedResults(string action, string antiForgeryPath)
{ {
// Arrange // Arrange
var server = TestHelper.CreateServer(_app, SiteName, _configureServices); var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
var client = server.CreateClient(); var client = server.CreateClient();
var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8"); var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8");
var outputFile = "compiler/resources/MvcTagHelpersWebSite.MvcTagHelper_Home." + action + ".html"; var outputFile = "compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home." + action + ".html";
var expectedContent = var expectedContent =
await ResourceFile.ReadResourceAsync(_resourcesAssembly, outputFile, sourceFile: false); await ResourceFile.ReadResourceAsync(_resourcesAssembly, outputFile, sourceFile: false);
// Act // Act
// The host is not important as everything runs in memory and tests are isolated from each other. // The host is not important as everything runs in memory and tests are isolated from each other.
var response = await client.GetAsync("http://localhost/MvcTagHelper_Home/" + action); var response = await client.GetAsync("http://localhost/HtmlGeneration_Home/" + action);
var responseContent = await response.Content.ReadAsStringAsync(); var responseContent = await response.Content.ReadAsStringAsync();
// Assert // Assert
@ -98,11 +98,11 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
[InlineData("EditWarehouse", null)] [InlineData("EditWarehouse", null)]
[InlineData("Index", null)] [InlineData("Index", null)]
[InlineData("Link", null)] [InlineData("Link", null)]
[InlineData("Order", "/MvcTagHelper_Order/Submit")] [InlineData("Order", "/HtmlGeneration_Order/Submit")]
[InlineData("OrderUsingHtmlHelpers", "/MvcTagHelper_Order/Submit")] [InlineData("OrderUsingHtmlHelpers", "/HtmlGeneration_Order/Submit")]
[InlineData("Product", null)] [InlineData("Product", null)]
[InlineData("Script", null)] [InlineData("Script", null)]
public async Task MvcTagHelpers_GenerateEncodedResults(string action, string antiForgeryPath) public async Task HtmlGenerationWebSite_GenerateEncodedResults(string action, string antiForgeryPath)
{ {
// Arrange // Arrange
var server = TestHelper.CreateServer(_app, SiteName, services => var server = TestHelper.CreateServer(_app, SiteName, services =>
@ -114,13 +114,13 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
}); });
var client = server.CreateClient(); var client = server.CreateClient();
var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8"); var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8");
var outputFile = "compiler/resources/MvcTagHelpersWebSite.MvcTagHelper_Home." + action + ".Encoded.html"; var outputFile = "compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home." + action + ".Encoded.html";
var expectedContent = var expectedContent =
await ResourceFile.ReadResourceAsync(_resourcesAssembly, outputFile, sourceFile: false); await ResourceFile.ReadResourceAsync(_resourcesAssembly, outputFile, sourceFile: false);
// Act // Act
// The host is not important as everything runs in memory and tests are isolated from each other. // The host is not important as everything runs in memory and tests are isolated from each other.
var response = await client.GetAsync("http://localhost/MvcTagHelper_Home/" + action); var response = await client.GetAsync("http://localhost/HtmlGeneration_Home/" + action);
var responseContent = await response.Content.ReadAsStringAsync(); var responseContent = await response.Content.ReadAsStringAsync();
// Assert // Assert
@ -156,11 +156,11 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Arrange // Arrange
var server = TestHelper.CreateServer(_app, SiteName, _configureServices); var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
var client = server.CreateClient(); var client = server.CreateClient();
var outputFile = "compiler/resources/MvcTagHelpersWebSite.MvcTagHelper_Customer.Index.html"; var outputFile = "compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Customer.Index.html";
var expectedContent = var expectedContent =
await ResourceFile.ReadResourceAsync(_resourcesAssembly, outputFile, sourceFile: false); await ResourceFile.ReadResourceAsync(_resourcesAssembly, outputFile, sourceFile: false);
var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/Customer/MvcTagHelper_Customer"); var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/Customer/HtmlGeneration_Customer");
var nameValueCollection = new List<KeyValuePair<string, string>> var nameValueCollection = new List<KeyValuePair<string, string>>
{ {
new KeyValuePair<string,string>("Number", string.Empty), new KeyValuePair<string,string>("Number", string.Empty),
@ -180,7 +180,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
responseContent = responseContent.Trim(); responseContent = responseContent.Trim();
var forgeryToken = var forgeryToken =
AntiForgeryTestHelper.RetrieveAntiForgeryToken(responseContent, "Customer/MvcTagHelper_Customer"); AntiForgeryTestHelper.RetrieveAntiForgeryToken(responseContent, "Customer/HtmlGeneration_Customer");
#if GENERATE_BASELINES #if GENERATE_BASELINES
// Reverse usual substitution and insert a format item into the new file content. // Reverse usual substitution and insert a format item into the new file content.
@ -476,14 +476,14 @@ Products: Laptops (3)";
var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8"); var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8");
var outputFile = string.Format( var outputFile = string.Format(
"compiler/resources/MvcTagHelpersWebSite.MvcTagHelper_Home.Form.Options.AntiForgery.{0}.html", "compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Form.Options.AntiForgery.{0}.html",
optionsAntiForgery?.ToString() ?? "null"); optionsAntiForgery?.ToString() ?? "null");
var expectedContent = var expectedContent =
await ResourceFile.ReadResourceAsync(_resourcesAssembly, outputFile, sourceFile: false); await ResourceFile.ReadResourceAsync(_resourcesAssembly, outputFile, sourceFile: false);
// Act // Act
// The host is not important as everything runs in memory and tests are isolated from each other. // The host is not important as everything runs in memory and tests are isolated from each other.
var response = await client.GetAsync("http://localhost/MvcTagHelper_Home/Form"); var response = await client.GetAsync("http://localhost/HtmlGeneration_Home/Form");
var responseContent = await response.Content.ReadAsStringAsync(); var responseContent = await response.Content.ReadAsStringAsync();
// Assert // Assert

View File

@ -1,6 +1,6 @@
<html> <html>
<body> <body>
<form action="/Customer/MvcTagHelper_Customer" method="post"> <form action="/Customer/HtmlGeneration_Customer" method="post">
<div> <div>
<label class="order" for="Number">Number</label> <label class="order" for="Number">Number</label>
<input class="form-control input-validation-error" type="number" data-val="true" data-val-range="The field Number must be between 1 and 100." data-val-range-max="100" data-val-range-min="1" data-val-required="The Number field is required." id="Number" name="Number" value="" /> <input class="form-control input-validation-error" type="number" data-val="true" data-val-range="The field Number must be between 1 and 100." data-val-range-max="100" data-val-range-min="1" data-val-required="The Number field is required." id="Number" name="Number" value="" />

View File

@ -1,6 +1,6 @@
<html> <html>
<body> <body>
<form action="/MvcTagHelper_Home/CreateWarehouse" method="post"> <div> <form action="/HtmlGeneration_Home/CreateWarehouse" method="post"> <div>
<label class="warehouse" for="City">City</label> <label class="warehouse" for="City">City</label>
<input size="50" type="text" data-val="true" data-val-minlength="The field City must be a string or array type with a minimum length of &#x27;2&#x27;." data-val-minlength-min="2" id="City" name="City" value="" /> <input size="50" type="text" data-val="true" data-val-minlength="The field City must be a string or array type with a minimum length of &#x27;2&#x27;." data-val-minlength-min="2" id="City" name="City" value="" />
<span class="field-validation-valid" data-valmsg-for="City" data-valmsg-replace="true"></span> <span class="field-validation-valid" data-valmsg-for="City" data-valmsg-replace="true"></span>

View File

@ -1,6 +1,6 @@
<html> <html>
<body> <body>
<form action="/Customer/MvcTagHelper_Customer" method="post"> <form action="/Customer/HtmlGeneration_Customer" method="post">
<div> <div>
<label class="order" for="Number">Number</label> <label class="order" for="Number">Number</label>
<input class="form-control" type="number" data-val="true" data-val-range="The field Number must be between 1 and 100." data-val-range-max="100" data-val-range-min="1" data-val-required="The Number field is required." id="Number" name="Number" value="" /> <input class="form-control" type="number" data-val="true" data-val-range="The field Number must be between 1 and 100." data-val-range-max="100" data-val-range-min="1" data-val-required="The Number field is required." id="Number" name="Number" value="" />

View File

@ -1,6 +1,6 @@
<html> <html>
<body> <body>
<form action="HtmlEncode[[/MvcTagHelper_Home/EditWarehouse]]" method="HtmlEncode[[post]]"> <form action="HtmlEncode[[/HtmlGeneration_Home/EditWarehouse]]" method="HtmlEncode[[post]]">
<div> <div>
HtmlEncode[[City_1]] HtmlEncode[[City_1]]
<input type="HtmlEncode[[text]]" data-val="HtmlEncode[[true]]" data-val-minlength="HtmlEncode[[The field City must be a string or array type with a minimum length of '2'.]]" data-val-minlength-min="HtmlEncode[[2]]" id="HtmlEncode[[City]]" name="HtmlEncode[[City]]" value="HtmlEncode[[City_1]]" /> <input type="HtmlEncode[[text]]" data-val="HtmlEncode[[true]]" data-val-minlength="HtmlEncode[[The field City must be a string or array type with a minimum length of '2'.]]" data-val-minlength-min="HtmlEncode[[2]]" id="HtmlEncode[[City]]" name="HtmlEncode[[City]]" value="HtmlEncode[[City_1]]" />

View File

@ -1,6 +1,6 @@
<html> <html>
<body> <body>
<form action="/MvcTagHelper_Home/EditWarehouse" method="post"> <form action="/HtmlGeneration_Home/EditWarehouse" method="post">
<div> <div>
City_1 City_1
<input type="text" data-val="true" data-val-minlength="The field City must be a string or array type with a minimum length of &#x27;2&#x27;." data-val-minlength-min="2" id="City" name="City" value="City_1" /> <input type="text" data-val="true" data-val-minlength="The field City must be a string or array type with a minimum length of &#x27;2&#x27;." data-val-minlength-min="2" id="City" name="City" value="City_1" />

View File

@ -1,6 +1,6 @@
<html> <html>
<body> <body>
<form action="/MvcTagHelper_Home/EmployeeList" method="post"> <form action="/HtmlGeneration_Home/EmployeeList" method="post">
<div> <div>
<label for="z0__Number">Number</label> <label for="z0__Number">Number</label>
<input data-val="true" data-val-range="The field Number must be between 1 and 100." data-val-range-max="100" data-val-range-min="1" data-val-required="The Number field is required." disabled="disabled" id="z0__Number" name="[0].Number" readonly="readonly" type="text" value="0" /> <input data-val="true" data-val-range="The field Number must be between 1 and 100." data-val-range-max="100" data-val-range-min="1" data-val-required="The Number field is required." disabled="disabled" id="z0__Number" name="[0].Number" readonly="readonly" type="text" value="0" />

View File

@ -0,0 +1,15 @@
<html>
<head>
<meta charset="utf-8" />
<title>Form</title>
</head>
<body>
<h2>Form Tag Helper Test</h2>
<form></form>
<form action="/HtmlGeneration_Home/Form" method="post"></form>
<form action="/HtmlGeneration_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{0}" /></form>
<form action="/HtmlGeneration_Home/Form" method="post"></form>
</body>
</html>

View File

@ -0,0 +1,15 @@
<html>
<head>
<meta charset="utf-8" />
<title>Form</title>
</head>
<body>
<h2>Form Tag Helper Test</h2>
<form></form>
<form action="/HtmlGeneration_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{0}" /></form>
<form action="/HtmlGeneration_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{1}" /></form>
<form action="/HtmlGeneration_Home/Form" method="post"></form>
</body>
</html>

View File

@ -0,0 +1,15 @@
<html>
<head>
<meta charset="utf-8" />
<title>Form</title>
</head>
<body>
<h2>Form Tag Helper Test</h2>
<form></form>
<form action="/HtmlGeneration_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{0}" /></form>
<form action="/HtmlGeneration_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{1}" /></form>
<form action="/HtmlGeneration_Home/Form" method="post"></form>
</body>
</html>

View File

@ -7,7 +7,7 @@
<a title="&quot;the&quot; title" href="">Product List</a> <a title="&quot;the&quot; title" href="">Product List</a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndex">MvcTagHelperTest Index</a> <a id="HtmlGenerationWebSite_Index">HtmlGenerationWebSite Index</a>
</div> </div>
<div> <div>
<a href="HtmlEncode[[/]]">Default Controller</a> <a href="HtmlEncode[[/]]">Default Controller</a>
@ -19,13 +19,13 @@
<a href="">Produt Submit Fragment</a> <a href="">Produt Submit Fragment</a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndexFragment" href="HtmlEncode[[/#fragment]]"> <a id="HtmlGenerationWebSite_IndexFragment" href="HtmlEncode[[/#fragment]]">
MvcTagHelperTest Index Fragment HtmlGenerationWebSite Index Fragment
</a> </a>
</div> </div>
<div> <div>
<a href="HtmlEncode[[ftp://localhost/#fragment]]"> <a href="HtmlEncode[[ftp://localhost/#fragment]]">
FTP MvcTagHelperTest Index Fragment FTP HtmlGenerationWebSite Index Fragment
</a> </a>
</div> </div>
<div> <div>
@ -34,8 +34,8 @@
</a> </a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndexProtocol" href="HtmlEncode[[/]]"> <a id="HtmlGenerationWebSite_IndexProtocol" href="HtmlEncode[[/]]">
Empty Protocol MvcTagHelperTest Index Empty Protocol HtmlGenerationWebSite Index
</a> </a>
</div> </div>
<div> <div>

View File

@ -7,7 +7,7 @@
<a title="&quot;the&quot; title" href="">Product List</a> <a title="&quot;the&quot; title" href="">Product List</a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndex">MvcTagHelperTest Index</a> <a id="HtmlGenerationWebSite_Index">HtmlGenerationWebSite Index</a>
</div> </div>
<div> <div>
<a href="/">Default Controller</a> <a href="/">Default Controller</a>
@ -19,13 +19,13 @@
<a href="">Produt Submit Fragment</a> <a href="">Produt Submit Fragment</a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndexFragment" href="/#fragment"> <a id="HtmlGenerationWebSite_IndexFragment" href="/#fragment">
MvcTagHelperTest Index Fragment HtmlGenerationWebSite Index Fragment
</a> </a>
</div> </div>
<div> <div>
<a href="ftp://localhost/#fragment"> <a href="ftp://localhost/#fragment">
FTP MvcTagHelperTest Index Fragment FTP HtmlGenerationWebSite Index Fragment
</a> </a>
</div> </div>
<div> <div>
@ -34,8 +34,8 @@
</a> </a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndexProtocol" href="/"> <a id="HtmlGenerationWebSite_IndexProtocol" href="/">
Empty Protocol MvcTagHelperTest Index Empty Protocol HtmlGenerationWebSite Index
</a> </a>
</div> </div>
<div> <div>

View File

@ -1,10 +1,10 @@
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title></title> <title></title>
</head> </head>
<body> <body>
<form action="HtmlEncode[[/MvcTagHelper_Order/Submit]]" method="HtmlEncode[[post]]"> <form action="HtmlEncode[[/HtmlGeneration_Order/Submit]]" method="HtmlEncode[[post]]">
<div> <div>
<label class="order" for="HtmlEncode[[Shipping]]">HtmlEncode[[Shipping]]</label> <label class="order" for="HtmlEncode[[Shipping]]">HtmlEncode[[Shipping]]</label>
<input size="50" type="HtmlEncode[[text]]" id="HtmlEncode[[Shipping]]" name="HtmlEncode[[Shipping]]" value="HtmlEncode[[Your shipping method is UPSP]]" /> <input size="50" type="HtmlEncode[[text]]" id="HtmlEncode[[Shipping]]" name="HtmlEncode[[Shipping]]" value="HtmlEncode[[Your shipping method is UPSP]]" />

View File

@ -1,10 +1,10 @@
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title></title> <title></title>
</head> </head>
<body> <body>
<form action="/MvcTagHelper_Order/Submit" method="post"> <form action="/HtmlGeneration_Order/Submit" method="post">
<div> <div>
<label class="order" for="Shipping">Shipping</label> <label class="order" for="Shipping">Shipping</label>
<input size="50" type="text" id="Shipping" name="Shipping" value="Your shipping method is UPSP" /> <input size="50" type="text" id="Shipping" name="Shipping" value="Your shipping method is UPSP" />

View File

@ -1,10 +1,10 @@
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title></title> <title></title>
</head> </head>
<body> <body>
<form action="HtmlEncode[[/MvcTagHelper_Order/Submit]]" method="HtmlEncode[[post]]"> <form action="HtmlEncode[[/HtmlGeneration_Order/Submit]]" method="HtmlEncode[[post]]">
<div> <div>
<label class="HtmlEncode[[order]]" for="HtmlEncode[[Shipping]]">HtmlEncode[[Shipping]]</label> <label class="HtmlEncode[[order]]" for="HtmlEncode[[Shipping]]">HtmlEncode[[Shipping]]</label>
<input id="HtmlEncode[[Shipping]]" name="HtmlEncode[[Shipping]]" size="HtmlEncode[[50]]" type="HtmlEncode[[text]]" value="HtmlEncode[[Your shipping method is UPSP]]" /> <input id="HtmlEncode[[Shipping]]" name="HtmlEncode[[Shipping]]" size="HtmlEncode[[50]]" type="HtmlEncode[[text]]" value="HtmlEncode[[Your shipping method is UPSP]]" />

View File

@ -1,10 +1,10 @@
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title></title> <title></title>
</head> </head>
<body> <body>
<form action="/MvcTagHelper_Order/Submit" method="post"> <form action="/HtmlGeneration_Order/Submit" method="post">
<div> <div>
<label class="order" for="Shipping">Shipping</label> <label class="order" for="Shipping">Shipping</label>
<input id="Shipping" name="Shipping" size="50" type="text" value="Your shipping method is UPSP" /> <input id="Shipping" name="Shipping" size="50" type="text" value="Your shipping method is UPSP" />

View File

@ -1,10 +1,10 @@
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title></title> <title></title>
</head> </head>
<body> <body>
<form method="get" action="HtmlEncode[[/MvcTagHelper_Home/ProductSubmit]]"> <form method="get" action="HtmlEncode[[/HtmlGeneration_Home/ProductSubmit]]">
<div> <div>
<label class="product" for="HtmlEncode[[HomePage]]">HtmlEncode[[HomePage]]</label> <label class="product" for="HtmlEncode[[HomePage]]">HtmlEncode[[HomePage]]</label>
<input size="50" type="HtmlEncode[[url]]" id="HtmlEncode[[HomePage]]" name="HtmlEncode[[HomePage]]" value="HtmlEncode[[http://www.contoso.com/]]" /> <input size="50" type="HtmlEncode[[url]]" id="HtmlEncode[[HomePage]]" name="HtmlEncode[[HomePage]]" value="HtmlEncode[[http://www.contoso.com/]]" />

View File

@ -1,10 +1,10 @@
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title></title> <title></title>
</head> </head>
<body> <body>
<form method="get" action="/MvcTagHelper_Home/ProductSubmit"> <form method="get" action="/HtmlGeneration_Home/ProductSubmit">
<div> <div>
<label class="product" for="HomePage">HomePage</label> <label class="product" for="HomePage">HomePage</label>
<input size="50" type="url" id="HomePage" name="HomePage" value="http://www.contoso.com/" /> <input size="50" type="url" id="HomePage" name="HomePage" value="http://www.contoso.com/" />

View File

@ -1,9 +1,9 @@
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
</head> </head>
<body> <body>
<form action="/MvcTagHelper_Product" method="post"> <div> <form action="/HtmlGeneration_Product" method="post"> <div>
<label class="product" for="z0__HomePage">HomePage</label> <label class="product" for="z0__HomePage">HomePage</label>
<input size="50" disabled="disabled" readonly="readonly" type="url" id="z0__HomePage" name="[0].HomePage" value="http://www.contoso.com/" /> <input size="50" disabled="disabled" readonly="readonly" type="url" id="z0__HomePage" name="[0].HomePage" value="http://www.contoso.com/" />
</div> </div>

View File

@ -1,15 +0,0 @@
<html>
<head>
<meta charset="utf-8" />
<title>Form</title>
</head>
<body>
<h2>Form Tag Helper Test</h2>
<form></form>
<form action="/MvcTagHelper_Home/Form" method="post"></form>
<form action="/MvcTagHelper_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{0}" /></form>
<form action="/MvcTagHelper_Home/Form" method="post"></form>
</body>
</html>

View File

@ -1,15 +0,0 @@
<html>
<head>
<meta charset="utf-8" />
<title>Form</title>
</head>
<body>
<h2>Form Tag Helper Test</h2>
<form></form>
<form action="/MvcTagHelper_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{0}" /></form>
<form action="/MvcTagHelper_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{1}" /></form>
<form action="/MvcTagHelper_Home/Form" method="post"></form>
</body>
</html>

View File

@ -1,15 +0,0 @@
<html>
<head>
<meta charset="utf-8" />
<title>Form</title>
</head>
<body>
<h2>Form Tag Helper Test</h2>
<form></form>
<form action="/MvcTagHelper_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{0}" /></form>
<form action="/MvcTagHelper_Home/Form" method="post"><input name="__RequestVerificationToken" type="hidden" value="{1}" /></form>
<form action="/MvcTagHelper_Home/Form" method="post"></form>
</body>
</html>

View File

@ -20,14 +20,15 @@
"ContentNegotiationWebSite": "1.0.0", "ContentNegotiationWebSite": "1.0.0",
"ControllerDiscoveryConventionsWebSite": "1.0.0", "ControllerDiscoveryConventionsWebSite": "1.0.0",
"ControllersFromServicesWebSite": "1.0.0", "ControllersFromServicesWebSite": "1.0.0",
"CorsWebSite": "1.0.0",
"CorsMiddlewareWebSite": "1.0.0", "CorsMiddlewareWebSite": "1.0.0",
"CorsWebSite": "1.0.0",
"CustomRouteWebSite": "1.0.0", "CustomRouteWebSite": "1.0.0",
"ErrorPageMiddlewareWebSite": "1.0.0", "ErrorPageMiddlewareWebSite": "1.0.0",
"FilesWebSite": "1.0.0", "FilesWebSite": "1.0.0",
"FiltersWebSite": "1.0.0", "FiltersWebSite": "1.0.0",
"FormatFilterWebSite": "1.0.0-*", "FormatFilterWebSite": "1.0.0-*",
"FormatterWebSite": "1.0.0", "FormatterWebSite": "1.0.0",
"HtmlGenerationWebSite": "1.0.0",
"InlineConstraintsWebSite": "1.0.0", "InlineConstraintsWebSite": "1.0.0",
"JsonPatchWebSite": "1.0.0", "JsonPatchWebSite": "1.0.0",
"LoggingWebSite": "1.0.0", "LoggingWebSite": "1.0.0",
@ -41,7 +42,6 @@
"Microsoft.Framework.Configuration.Json": "1.0.0-*", "Microsoft.Framework.Configuration.Json": "1.0.0-*",
"ModelBindingWebSite": "1.0.0", "ModelBindingWebSite": "1.0.0",
"MvcSample.Web": "1.0.0", "MvcSample.Web": "1.0.0",
"MvcTagHelpersWebSite": "1.0.0",
"PrecompilationWebSite": "1.0.0", "PrecompilationWebSite": "1.0.0",
"RazorCompilerCacheWebSite": "1.0.0", "RazorCompilerCacheWebSite": "1.0.0",
"RazorEmbeddedViewsWebSite": "1.0.0", "RazorEmbeddedViewsWebSite": "1.0.0",

View File

@ -1,15 +1,14 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
namespace MvcTagHelpersWebSite.Areas.Customer.Controllers namespace HtmlGenerationWebSite.Areas.Customer.Controllers
{ {
[Area("Customer")] [Area("Customer")]
public class MvcTagHelper_CustomerController : Controller public class HtmlGeneration_CustomerController : Controller
{ {
public IActionResult Index(MvcTagHelpersWebSite.Models.Customer customer) public IActionResult Index(Models.Customer customer)
{ {
return View("Customer"); return View("Customer");
} }

View File

@ -5,7 +5,7 @@ using Microsoft.AspNet.Mvc;
using Microsoft.Framework.Caching; using Microsoft.Framework.Caching;
using Microsoft.Framework.Caching.Memory; using Microsoft.Framework.Caching.Memory;
namespace MvcTagHelpersWebSite.Components namespace HtmlGenerationWebSite.Components
{ {
public class ProductsViewComponent : ViewComponent public class ProductsViewComponent : ViewComponent
{ {

View File

@ -4,7 +4,7 @@
using System.Security.Claims; using System.Security.Claims;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
namespace MvcTagHelpersWebSite.Controllers namespace HtmlGenerationWebSite.Controllers
{ {
public class Catalog_CacheTagHelperController : Controller public class Catalog_CacheTagHelperController : Controller
{ {

View File

@ -3,13 +3,13 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HtmlGenerationWebSite.Models;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering; using Microsoft.AspNet.Mvc.Rendering;
using MvcTagHelpersWebSite.Models;
namespace MvcTagHelpersWebSite.Controllers namespace HtmlGenerationWebSite.Controllers
{ {
public class MvcTagHelper_HomeController : Controller public class HtmlGeneration_HomeController : Controller
{ {
private readonly List<Product> _products = new List<Product> private readonly List<Product> _products = new List<Product>
{ {
@ -48,7 +48,7 @@ namespace MvcTagHelpersWebSite.Controllers
Products = new List<int> { 0, 1 }, Products = new List<int> { 0, 1 },
}; };
public MvcTagHelper_HomeController() public HtmlGeneration_HomeController()
{ {
_productsList = new SelectList(_products, "Number", "ProductName"); _productsList = new SelectList(_products, "Number", "ProductName");
_productsListWithSelection = new SelectList(_products, "Number", "ProductName", 2); _productsListWithSelection = new SelectList(_products, "Number", "ProductName", 2);
@ -156,7 +156,7 @@ namespace MvcTagHelpersWebSite.Controllers
{ {
return View(); return View();
} }
public IActionResult Link() public IActionResult Link()
{ {
return View(); return View();

View File

@ -2,12 +2,12 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using HtmlGenerationWebSite.Models;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
using MvcTagHelpersWebSite.Models;
namespace MvcTagHelpersWebSite.Controllers namespace HtmlGenerationWebSite.Controllers
{ {
public class MvcTagHelper_OrderController : Controller public class HtmlGeneration_OrderController : Controller
{ {
public IActionResult Submit(Order order) public IActionResult Submit(Order order)
{ {

View File

@ -2,12 +2,12 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using HtmlGenerationWebSite.Models;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
using MvcTagHelpersWebSite.Models;
namespace MvcTagHelpersWebSite.Controllers namespace HtmlGenerationWebSite.Controllers
{ {
public class MvcTagHelper_ProductController : Controller public class HtmlGeneration_ProductController : Controller
{ {
public IActionResult Index() public IActionResult Index()
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace MvcTagHelpersWebSite.Models namespace HtmlGenerationWebSite.Models
{ {
public class Customer : Person public class Customer : Person
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace MvcTagHelpersWebSite.Models namespace HtmlGenerationWebSite.Models
{ {
public class Employee : Person public class Employee : Person
{ {

View File

@ -6,7 +6,7 @@ using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Features.Internal; using Microsoft.AspNet.Http.Features.Internal;
using Microsoft.AspNet.Http.Internal; using Microsoft.AspNet.Http.Internal;
namespace MvcTagHelpersWebSite.Models namespace HtmlGenerationWebSite.Models
{ {
public class Folder public class Folder
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace MvcTagHelpersWebSite.Models namespace HtmlGenerationWebSite.Models
{ {
public enum Gender public enum Gender
{ {

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace MvcTagHelpersWebSite.Models namespace HtmlGenerationWebSite.Models
{ {
public class Order public class Order
{ {

View File

@ -4,7 +4,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
namespace MvcTagHelpersWebSite.Models namespace HtmlGenerationWebSite.Models
{ {
public class Person public class Person
{ {

View File

@ -2,10 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace MvcTagHelpersWebSite.Models namespace HtmlGenerationWebSite.Models
{ {
public class Product public class Product
{ {

View File

@ -3,7 +3,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace MvcTagHelpersWebSite.Models namespace HtmlGenerationWebSite.Models
{ {
public class Warehouse public class Warehouse
{ {

View File

@ -3,9 +3,8 @@
using System.Threading; using System.Threading;
using Microsoft.Framework.Caching; using Microsoft.Framework.Caching;
using Microsoft.Framework.Caching.Memory;
namespace MvcTagHelpersWebSite namespace HtmlGenerationWebSite
{ {
public class ProductsService public class ProductsService
{ {

View File

@ -4,7 +4,7 @@
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection;
namespace MvcTagHelpersWebSite namespace HtmlGenerationWebSite
{ {
public class Startup public class Startup
{ {
@ -25,7 +25,7 @@ namespace MvcTagHelpersWebSite
routes.MapRoute( routes.MapRoute(
name: "default", name: "default",
template: "{controller}/{action}/{id?}", template: "{controller}/{action}/{id?}",
defaults: new { controller = "MvcTagHelper_Home", action = "Index" }); defaults: new { controller = "HtmlGeneration_Home", action = "Index" });
routes.MapRoute( routes.MapRoute(
name: "areaRoute", name: "areaRoute",
template: "{area:exists}/{controller}/{action}/{id?}", template: "{area:exists}/{controller}/{action}/{id?}",

View File

@ -1,4 +1,4 @@
@model MvcTagHelpersWebSite.Models.Warehouse @model HtmlGenerationWebSite.Models.Warehouse
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@ -8,7 +8,7 @@
<html> <html>
<body> <body>
@using (Html.BeginForm("CreateWarehouse", "MvcTagHelper_Home")) @using (Html.BeginForm("CreateWarehouse", "HtmlGeneration_Home"))
{ {
<div> <div>
<label asp-for="City" class="warehouse"></label> <label asp-for="City" class="warehouse"></label>

View File

@ -1,4 +1,4 @@
@model MvcTagHelpersWebSite.Models.Warehouse @model HtmlGenerationWebSite.Models.Warehouse
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@ -8,7 +8,7 @@
<html> <html>
<body> <body>
<form asp-controller="MvcTagHelper_Home" asp-action="EditWarehouse" asp-anti-forgery="false"> <form asp-controller="HtmlGeneration_Home" asp-action="EditWarehouse" asp-anti-forgery="false">
<div> <div>
@Html.DisplayFor(m => m.City) @Html.DisplayFor(m => m.City)
<input asp-for="City" type="text" /> <input asp-for="City" type="text" />

View File

@ -1,4 +1,4 @@
@model MvcTagHelpersWebSite.Models.Employee @model HtmlGenerationWebSite.Models.Employee
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

View File

@ -0,0 +1,4 @@
@using HtmlGenerationWebSite.Models
@model Gender
@Html.RadioButtonFor(m => m, value: "Male") Male
@Html.RadioButtonFor(m => m, value: "Female") Female

View File

@ -1,4 +1,4 @@
@using MvcTagHelpersWebSite.Models @using HtmlGenerationWebSite.Models
@model Gender @model Gender
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
<input asp-for="@Model" type="radio" value="Male" /> Male <input asp-for="@Model" type="radio" value="Male" /> Male

View File

@ -1,4 +1,4 @@
@using MvcTagHelpersWebSite.Models @using HtmlGenerationWebSite.Models
@model List<Employee> @model List<Employee>
@ -10,7 +10,7 @@
<body> <body>
@if (Model != null && Model.Count() != 0) @if (Model != null && Model.Count() != 0)
{ {
using (@Html.BeginForm("EmployeeList", "MvcTagHelper_Home", FormMethod.Post)) using (@Html.BeginForm("EmployeeList", "HtmlGeneration_Home", FormMethod.Post))
{ {
for (int i = 0; i < Model.Count; ++i) for (int i = 0; i < Model.Count; ++i)
{ {

View File

@ -0,0 +1,18 @@
@using Microsoft.Framework.DependencyInjection
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
<html>
<head>
<meta charset="utf-8" />
<title>Form</title>
</head>
<body>
<h2>Form Tag Helper Test</h2>
<form></form>
<form asp-controller="HtmlGeneration_Home" asp-action="Form"></form>
<form asp-controller="HtmlGeneration_Home" asp-action="Form" asp-anti-forgery="true"></form>
<form asp-controller="HtmlGeneration_Home" asp-action="Form" asp-anti-forgery="false"></form>
</body>
</html>

View File

@ -13,7 +13,7 @@
<a asp-controller="Product" asp-action="List" title='"the" title'>Product List</a> <a asp-controller="Product" asp-action="List" title='"the" title'>Product List</a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndex">MvcTagHelperTest Index</a> <a id="HtmlGenerationWebSite_Index">HtmlGenerationWebSite Index</a>
</div> </div>
<div> <div>
<a asp-action="Index">Default Controller</a> <a asp-action="Index">Default Controller</a>
@ -25,13 +25,13 @@
<a asp-controller="Product" asp-action="Submit" asp-fragment="fragment">Produt Submit Fragment</a> <a asp-controller="Product" asp-action="Submit" asp-fragment="fragment">Produt Submit Fragment</a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndexFragment" asp-fragment="fragment"> <a id="HtmlGenerationWebSite_IndexFragment" asp-fragment="fragment">
MvcTagHelperTest Index Fragment HtmlGenerationWebSite Index Fragment
</a> </a>
</div> </div>
<div> <div>
<a asp-action="Index" asp-fragment="fragment" asp-protocol="ftp"> <a asp-action="Index" asp-fragment="fragment" asp-protocol="ftp">
FTP MvcTagHelperTest Index Fragment FTP HtmlGenerationWebSite Index Fragment
</a> </a>
</div> </div>
<div> <div>
@ -40,8 +40,8 @@
</a> </a>
</div> </div>
<div> <div>
<a id="MvcTagHelperTestIndexProtocol" asp-protocol=""> <a id="HtmlGenerationWebSite_IndexProtocol" asp-protocol="">
Empty Protocol MvcTagHelperTest Index Empty Protocol HtmlGenerationWebSite Index
</a> </a>
</div> </div>
<div> <div>

View File

@ -1,4 +1,4 @@
@using MvcTagHelpersWebSite.Models @using HtmlGenerationWebSite.Models
@model Folder @model Folder
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

View File

@ -1,4 +1,4 @@
@model MvcTagHelpersWebSite.Models.Order @model HtmlGenerationWebSite.Models.Order
@{ @{
ViewBag.Title = "Order Page"; ViewBag.Title = "Order Page";
@ -18,7 +18,7 @@
<title></title> <title></title>
</head> </head>
<body> <body>
<form asp-controller="MvcTagHelper_Order" asp-action="Submit" asp-anti-forgery=" true"> <form asp-controller="HtmlGeneration_Order" asp-action="Submit" asp-anti-forgery=" true">
<div> <div>
<label asp-for="Shipping" class="order"></label> <label asp-for="Shipping" class="order"></label>
<input asp-for="Shipping" type="text" asp-format="Your shipping method is {0}" size="50" /> <input asp-for="Shipping" type="text" asp-format="Your shipping method is {0}" size="50" />

View File

@ -1,4 +1,4 @@
@model MvcTagHelpersWebSite.Models.Order @model HtmlGenerationWebSite.Models.Order
@{ @{
ViewBag.Title = "Order Page"; ViewBag.Title = "Order Page";
@ -12,7 +12,7 @@
</head> </head>
<body> <body>
@* Use comments and <text/> elements to force whitespace in generated HTML. *@@using ( @* Use comments and <text/> elements to force whitespace in generated HTML. *@@using (
Html.BeginForm(actionName: "Submit", controllerName: "MvcTagHelper_Order")) Html.BeginForm(actionName: "Submit", controllerName: "HtmlGeneration_Order"))
{<text></text> {<text></text>
<div> <div>
@Html.LabelFor(m => m.Shipping, htmlAttributes: new { @class = "order" }) @Html.LabelFor(m => m.Shipping, htmlAttributes: new { @class = "order" })

View File

@ -1,4 +1,4 @@
@model MvcTagHelpersWebSite.Models.Product @model HtmlGenerationWebSite.Models.Product
@{ @{
ViewBag.Title = "Product Page"; ViewBag.Title = "Product Page";
@ -12,7 +12,7 @@
<title></title> <title></title>
</head> </head>
<body> <body>
<form asp-controller="MvcTagHelper_Home" asp-route-action="ProductSubmit" asp-anti-forgery="false" method="get"> <form asp-controller="HtmlGeneration_Home" asp-route-action="ProductSubmit" asp-anti-forgery="false" method="get">
<div> <div>
<label asp-for="HomePage" class="product"></label> <label asp-for="HomePage" class="product"></label>
<input asp-for="HomePage" type="url" size="50" /> <input asp-for="HomePage" type="url" size="50" />

View File

@ -1,4 +1,4 @@
@using MvcTagHelpersWebSite.Models @using HtmlGenerationWebSite.Models
@model IEnumerable<Product> @model IEnumerable<Product>
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@ -8,7 +8,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
</head> </head>
<body> <body>
@using (@Html.BeginForm("Index", "MvcTagHelper_Product", FormMethod.Post)) @using (@Html.BeginForm("Index", "HtmlGeneration_Product", FormMethod.Post))
{ {
var index = 0; var index = 0;
var fieldPrefix = ViewData.TemplateInfo.HtmlFieldPrefix; var fieldPrefix = ViewData.TemplateInfo.HtmlFieldPrefix;

View File

@ -1,4 +1,4 @@
@model MvcTagHelpersWebSite.Models.Product @model HtmlGenerationWebSite.Models.Product
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

View File

@ -1,4 +1,4 @@
@model MvcTagHelpersWebSite.Models.Customer @model HtmlGenerationWebSite.Models.Customer
@{ @{
ViewBag.Title = "Customer Page"; ViewBag.Title = "Customer Page";
@ -8,7 +8,7 @@
<html> <html>
<body> <body>
<form asp-route-area="Customer" asp-controller="MvcTagHelper_Customer" asp-action="Index"> <form asp-route-area="Customer" asp-controller="HtmlGeneration_Customer" asp-action="Index">
<div> <div>
<label asp-for="Number" class="order"></label> <label asp-for="Number" class="order"></label>
<input asp-for="Number" type="number" class="form-control" /> <input asp-for="Number" type="number" class="form-control" />

View File

@ -0,0 +1,4 @@
HtmlGenerationWebSite
===
This web site illustrates how to use MVC HTML and tag helpers.

View File

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 360 B

View File

@ -1,4 +0,0 @@
@using MvcTagHelpersWebSite.Models
@model Gender
@Html.RadioButtonFor(m => m, value: "Male") Male
@Html.RadioButtonFor(m => m, value: "Female") Female

View File

@ -1,18 +0,0 @@
@using Microsoft.Framework.DependencyInjection
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
<html>
<head>
<meta charset="utf-8" />
<title>Form</title>
</head>
<body>
<h2>Form Tag Helper Test</h2>
<form></form>
<form asp-controller="MvcTagHelper_Home" asp-action="Form"></form>
<form asp-controller="MvcTagHelper_Home" asp-action="Form" asp-anti-forgery="true"></form>
<form asp-controller="MvcTagHelper_Home" asp-action="Form" asp-anti-forgery="false"></form>
</body>
</html>

View File

@ -1,4 +0,0 @@
MvcTagHelpersWebSite
===
This web site illustrates how to use MVC tag helpers.