Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC Jquery go to controller action

In Jquery, I need to tell the program to go to EmployeeController and Empl action. How do I tell it do this. I want to simple way to do this without using ajax.

like image 281
Nate Pet Avatar asked Nov 30 '11 20:11

Nate Pet


1 Answers

window.location.href = "/{controller}/{action}" //in your case, /employee/empl

This works because of the routes specified in your Global.asax.cs file. I suggest you read up on how this works as it's one of the fundamentals of MVC....

like image 109
Adam Terlson Avatar answered Oct 04 '22 12:10

Adam Terlson