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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Metadata ignored for non model-specific EditorTemplate
Issue - #2778
- Loading branch information
1 parent
6210de9
commit 92f3e21
Showing
12 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// 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. | ||
|
||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace HtmlGenerationWebSite.Models | ||
{ | ||
public class Item | ||
{ | ||
[UIHint("Common")] | ||
[Display(Name = "ItemName")] | ||
public string Name { get; set; } | ||
|
||
[UIHint("Common")] | ||
[Display(Name = "ItemNo")] | ||
public int Id { get; set; } | ||
|
||
[Display(Name = "ItemDesc")] | ||
public string Description { get; set; } | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...mlGenerationWebSite/Views/HtmlGeneration_Home/ItemUsingModelSpecificEditorTemplate.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@using HtmlGenerationWebSite.Models | ||
@model Item | ||
@Html.Editor(nameof(Model.Description)) |
5 changes: 5 additions & 0 deletions
5
...ites/HtmlGenerationWebSite/Views/HtmlGeneration_Home/ItemUsingSharedEditorTemplate.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@using HtmlGenerationWebSite.Models | ||
@model Item | ||
|
||
@Html.EditorFor(model => model.Name) | ||
@Html.Editor("Id") |
2 changes: 2 additions & 0 deletions
2
test/WebSites/HtmlGenerationWebSite/Views/Shared/EditorTemplates/Common.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@Html.LabelFor(m => m, new { @class = "control-label col-md-2" }) | ||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue) |
3 changes: 3 additions & 0 deletions
3
test/WebSites/HtmlGenerationWebSite/Views/Shared/EditorTemplates/String.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@model string | ||
@Html.LabelFor(m => m) | ||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue) |