Only one page gives a 405 error when changing the language. Net Core 6. Microsoft Identity.

Volk Volk 571 Reputation points
2022-09-11T18:33:48.17+00:00

Hi!

There is Areas\Customer\Views\User\ConfirmEmail.cshtml
HomeController checks whether the user's mail is confirmed and simply reports it.
The page is very simple. The most interesting thing is that there are a lot of pages working with authentication and everything works as it should when changing languages.
But only this page gives this error and I don't understand why.

Will anyone advise me at least where to dig?

Thanks!

@model EmailConfirmModel;  
  
@{  
    ViewData["Title"] = "ConfirmEmail";  
}  
  
@inject LanguageService language  
  
<br/>  
  
<h2 class="text-info">@language.Getkey("this_email_confirmed")</h2>  
  
<label asp-for="Email">@Model.Email</label>  
  
<a asp-area="Identity" class="button large" asp-page="/Account/Login">@language.Getkey("login")</a>  

239894-error.png

239895-errorinconsole.png

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,166 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JasonPan - MSFT 4,201 Reputation points Microsoft Vendor
    2022-09-12T06:42:50.677+00:00

    Hi @Volk Volk

    Please check this page method in your controller. If you have add some attribute like [HttpPost], you need to delete it.

    I have test it in my local, I add [HttpPost] in the method, like below.

    [HttpPost]  
    publish IActionResult Privacy(){  
        return View();  
    }  
    

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards
    Jason

    1 person found this answer helpful.