Home > database >  call method from _layout.cshtml
call method from _layout.cshtml

Time:07-28

_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:

Before I click the button

After I click the button: After I click the button

  • Related