jQuery AJAX works to return mvc 3 partial view but jQuery load doesn't

后端 未结 3 2128
挽巷
挽巷 2021-01-25 13:13

I\'m trying to populate a div with a partial view in MVC 3. My controller looks like this:

[HttpPost]
public ActionResult GetCustomerList(string searchString)
{         


        
3条回答
  •  后悔当初
    2021-01-25 13:16

    Jquery docs for load says...

    The POST method is used if data is provided as an object; otherwise, GET is assumed.
    

    since you are passing data as an object, it has to be a post call according to docs. Furthermore, you are getting required data from controller through $.ajax so controller action method seems to be alright. There may be some error when sending the ajax request using load. you can inspect this in firebug.

提交回复
热议问题