From f2162a814f84f95de7b512cf87a559ea1339b2ab Mon Sep 17 00:00:00 2001 From: Prafull Bhosale Date: Thu, 23 Jun 2016 16:22:05 -0700 Subject: [PATCH] Fix validation span tags for Create and Edit pages. Fixes #227 Fixes #228 --- .../ControllerGenerator/ControllerWithActions.cshtml | 1 + .../Templates/ViewGenerator/Create.cshtml | 4 ++-- .../Templates/ViewGenerator/Edit.cshtml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ControllerGenerator/ControllerWithActions.cshtml b/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ControllerGenerator/ControllerWithActions.cshtml index dd5911aaf..9a0412589 100644 --- a/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ControllerGenerator/ControllerWithActions.cshtml +++ b/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ControllerGenerator/ControllerWithActions.cshtml @@ -5,6 +5,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; + @{string modelName = (Model.ClassName.EndsWith("Controller")? Model.ClassName.Substring(0,Model.ClassName.Length-10): Model.ClassName);} namespace @Model.NamespaceName { diff --git a/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ViewGenerator/Create.cshtml b/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ViewGenerator/Create.cshtml index 8556cf6d2..3cef999ef 100644 --- a/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ViewGenerator/Create.cshtml +++ b/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ViewGenerator/Create.cshtml @@ -80,7 +80,7 @@ @: @:
@: - @: + @: @:
@: } @@ -90,7 +90,7 @@ @: @:
@: - @: + @: @:
@: } diff --git a/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ViewGenerator/Edit.cshtml b/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ViewGenerator/Edit.cshtml index e7852751b..b4d07000c 100644 --- a/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ViewGenerator/Edit.cshtml +++ b/src/Microsoft.VisualStudio.Web.CodeGenerators.Mvc/Templates/ViewGenerator/Edit.cshtml @@ -62,7 +62,7 @@ @: @:
@: - @: + @: @:
@: continue; @@ -96,7 +96,7 @@ @: @:
@: - @: + @: @:
@: }