I have an overloaded action in my method, one declared with and the other with .
I use the Post metod to handle my form’s submit button, which works fine.
I wanted the HttpGet method to handle a jQuery .load() action but that is instead also being caught by my Post method.
Any idea what I’m missing? Do I have to explicitl call a .get() or .ajax() to hit the right action?
Thanks!
-Ben
The
.loadmethod could send an HTTP POST AJAX request as stated in the documentation:For example
will send a POST request.
If you want to be sure use
$.get, or$.ajaxwithtype: 'GET'. Also don’t forget that if you use GET request for AJAX some browsers might cache the results and get you into trouble or at least some weird behavior, so if you want fresh contents from your server use$.ajaxwithcache: falseparameter.