I have the following in my MVC View:
<a href='@Url.Action("EmailPerson", "SupportNeeded")'> Email </a>
Below, SupportNeeded is the Controller and EmailPerson in the method
What is the equivalent if I do it in Jquery. Obviously I do not need the Email Lable. I just want it to automatically go to EmailPerson Method in SupportNeeded controller.
Note that I have EmailPerson and EmailPerson with HttpPost in my controller.
I tried in my Jquery
'@Url.Action("EmailPerson", "SupportNeeded")'
but that didn't do anything for me. I also tried the .post :
var url = '@Url.Action("EmailPerson", "SupportNeeded")';
$.post(url), function (data) { });
but it went to the Method that has [HttpPost]. I need it to go to the method that does not have [HttpPost]. I then tried .get but did not do anything for me.