_layout.cshtml:
<a href="#">Press</a>
index.cshtml.cs:
public void CallFromA()
{
//do somting
}
What is the syntax to access the function?
CodePudding user response:
To call a method in the controller from a view you will need to use Ajax call from the view.
Have a look at this S.O thread which covers the same topic: