AJAX注入PartialView应用Jquery(ASP.NET AJAX JQUERY HTML)

时间:2013-09-11 13:27:24

标签: c# jquery asp.net ajax html5

如果有人能帮助我,那就太棒了。 我正在创建一个使用AJAX将部分视图注入我的主页面的Web应用程序。 我正在使用jquery .accoridon能够在主视图中切换这些加载了AJAX的视图(div)。但是,这不起作用。在使用AJAX之前,手风琴工作正常。

我已尝试将.on .live .delegate用于jquery函数,但仍然没有运气。

以下是我的页面中要将内容加载到手风琴中的部分

 <script>
    $(function () {
        $("#accordion").delegate.accordion({
            collapsible: true
        });
    });
  </script>
<div id="accordion">
        <div id="replace2">            
        <div id="replace1">
            <!-- This is where content is loaded too via ajax, it's needed so the #accordian  div is not      reaplced --> 
        </div>
        </div>
</div>

下一部分是我如何添加第一部分ajax内容

的示例
@Ajax.ActionLink("Create New",
    "create_new", new AjaxOptions { 
    UpdateTargetId="replace1",
    InsertionMode= InsertionMode.Replace,
    HttpMethod = "GET"
    })

这就是我如何更新我的第二部分ajax内容

  @Ajax.ActionLink("Create New",
    "create_new", new AjaxOptions { 
    UpdateTargetId="replace2",
    InsertionMode= InsertionMode.Replace,
    HttpMethod = "GET"
    })

有没有人知道如何将这些内容加载到workign jquery手风琴中?

谢谢, 标记

0 个答案:

没有答案