weixin_33698043 2014-04-01 15:39 采纳率: 0%
浏览 30

Ajax Mvc提交部分视图

i am new to ajax and i can't find a way to get passed my problem.

i have a view, on the left side there is a menu with ajax action links, which are updating the div on the right side with different partial views.

this views on the right side have submit buttons.

now my question, i don't wan't this button, each partial view should update or trigger the submit automatically, once the next menu click gets fired.

before i changed the menu to ajax.actionlinks i had done this by hooking the onbeforeunload event. but this event doesn't get fired with ajax updatetargetid.

here some code snippets:

index.cshtml

<div class="col-lg-3">
    @Html.Partial("_Navigation")
</div>
<div id="LoadPageContainer" class="col-lg-9"></div>

_navigation.cshtml

 <li>
 @Ajax.ActionLink("one", "_one", new AjaxOptions() { UpdateTargetId = "LoadPageContainer", InsertionMode = InsertionMode.Replace })
  </li>
  <li>
  @Ajax.ActionLink("two", "_two", new AjaxOptions() { UpdateTargetId = "LoadPageContainer", InsertionMode = InsertionMode.Replace })
  </li>

Edit: Adding the OnBegin AjaxOptions did the job for me.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题