ajax.actionlink正在重新发送整个页面内容

时间:2013-10-27 06:31:01

标签: jquery asp.net-mvc asp.net-ajax

我一直在尝试在asp.net mvc中实现ajax.actionlink 3.below是我的ajax.action链接代码

<div id="changing-content">

 </div>

 @Ajax.ActionLink("Next","Phone",new {id = 2},new AjaxOptions { 
HttpMethod="Get",
UpdateTargetId = "changing-content",
InsertionMode = InsertionMode.Replace

 });

和控制器

public ActionResult Phones(int ? id) {
    if (id == null) id = 1;
    Models.Phones phonoes = new Models.Phones();
    //  return View(new Models.PhonesList { phonesList = paginateRsult(id,        "").ToList() });
    return View(paginateRsult(id, "").ToList());
}

当我点击链接时,它只是重新发送整个页面内容并添加我传递给ajax选项的div。

0 个答案:

没有答案