I need to add a subscribe form to my Layout so it is on all pages in the right side area.
How do I handle the post action as layouts dont have a codefile?
What I have so far is my layout has a signup partial and in that partial is the form. At this point I ponder what to do and what is the correct and safe way on handling user input and the action handler.
Create a Razor page e.g. Subscribe.cshtml that handles the form submission and specify that page in the asp-page
attribute of the form tag helper:
<form method="post" asp-page="/Subscribe">
Process the submission in the OnPost
handler of SubscribeModel
.