I have a cshtml MVC Razor page, where I have a "Register" button. I want to make an onclick event with a name for example "registerFUNCTION" name, and I want to make a function called "registerFUNCTION" in cshtml.cs file. I want to write the code for registrating, but in the beginning, I don't know, how can I call and write a function in cshml.cs. Is it possible? Like:
cshtml file:
<button onclick="registerFUNCTION" value="Register"/>
cshtml.cs file:
void registerFUNCTION(Object sender, EventArgs e)
{
....
}
I know that is not working, I just wondered to make like this, just only don't know the syntax. I worked in visual studio c# programming, but I need to make this in visual studio code web API c#, and it's new to me. I didn't find any answer on the internet