asp.net mvc - Can you call a method from a Controller if the View was created from a different Controller? -


Say I use Index () to the Home Controller which is the View Index. Espacks, jquery javascript in jquery index.aspx on a call in another controller (external controller)?

  $ Ajax ({type: "POST", url: "/ home / say", data type: "jason", data: ({CurrRow: centerPost [0], offset: ((-1 * math.cissil (number / 2)) + 1)}, error: function (request) {warning (request.statusText)}, success: work (results) {warning (result)}}). Reaction text;  

I did not give any error, page provided from home controller

  $ Ajax ({type: "POST", url: "/ row / GetRowName", data type: "Jason", data: ({currRow: centerPost [0], offset: ((-1 * math.cell (number / 2 )), Error: function (request) {warning (Request.statusText)}, success: work (results) {warning (result)}}). Reaction text;  

gave me an internal server error ...

Just wondering if this could be because I'm calling a different controller, / P >

There should be no reason, because the result of your current view will result in calling any different controller In the errors of which a controller is just a group of common commands, this command is the address bar of the browser State hyperlinks are issued by or call Ajax and jQuery, it does not matter. All three controllers use the same protocol to issue orders.

My guess is there is something wrong with your code that is causing the internal server error. Are you trying to go straight into the browser / row / gateway, to see what happens? ? Does it work with GET and POST, only posts, GET only? When you only support GET, are you releasing a post? Before I can help you, I will need more information.


Comments