From eb781d5a0e1c92f7e97486e3816cdfe4d526e498 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 23 Jun 2021 14:51:06 +0300 Subject: [PATCH] Blog: Make content required resolves https://github.com/abpframework/abp/issues/9256 --- .../src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs | 3 ++- .../src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs index 6d998a7172..c38cb1b954 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs @@ -97,6 +97,7 @@ namespace Volo.Blogging.Pages.Blog.Posts [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxUrlLength))] public string Url { get; set; } + [Required] [HiddenInput] [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxContentLength))] public string Content { get; set; } @@ -106,4 +107,4 @@ namespace Volo.Blogging.Pages.Blog.Posts public string Tags { get; set; } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs index 3930a79900..e377a006a3 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs @@ -91,6 +91,7 @@ namespace Volo.Blogging.Pages.Blog.Posts [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxUrlLength))] public string Url { get; set; } + [Required] [HiddenInput] [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxContentLength))] public string Content { get; set; } @@ -102,4 +103,4 @@ namespace Volo.Blogging.Pages.Blog.Posts } } -} \ No newline at end of file +}