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 468f2ab191..55bb220d54 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 @@ -50,6 +50,7 @@ namespace Volo.Blogging.Pages.Blog.Posts var postDto = await _postAppService.GetAsync(new Guid(PostId)); Post = ObjectMapper.Map(postDto); Post.Tags = String.Join(", ", postDto.Tags.Select(p => p.Name).ToArray()); + Post.Url = WebUtility.UrlDecode(Post.Url); return Page(); } @@ -60,7 +61,7 @@ namespace Volo.Blogging.Pages.Blog.Posts { BlogId = Post.BlogId, Title = Post.Title, - Url = Post.Url, + Url = WebUtility.UrlEncode(Post.Url), CoverImage = Post.CoverImage, Content = Post.Content, Tags = Post.Tags, 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 e377a006a3..396e225727 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 @@ -66,6 +66,8 @@ namespace Volo.Blogging.Pages.Blog.Posts Post.Description = Post.Content.Truncate(PostConsts.MaxSeoFriendlyDescriptionLength); } + Post.Url = WebUtility.UrlEncode(Post.Url); + var postWithDetailsDto = await _postAppService.CreateAsync(ObjectMapper.Map(Post)); //TODO: Try Url.Page(...)