Why form in RCL(Razor Class Library) no working in asp.net core?

the public IActionResult Contact(Models.VistorModel Vistor) never be invoked while I clicked the button. It always invokes the public IActionResult Contact()only.

Please try to set method="post" for your form tag, like below.

<form id="ContactForm" method="post" asp-action="Contact">

Update:

To make the Form tag helper etc available to view(s) in RCL, we can add following code in view page or Razor View Imports file.

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top