MVC - 用于触发Ajax.ActionLink的按钮

Jud*_*udy 4 ajax asp.net-mvc

@Ajax.ActionLink(
    "Link Text", 
    "RefreshTestStatus2", 
    "refresh",
    new AjaxOptions { 
        UpdateTargetId = "status", 
        InsertionMode = InsertionMode.InsertBefore })
Run Code Online (Sandbox Code Playgroud)

但我想使用看似提交按钮的东西来解雇它.有谁知道如何做到这一点?

朱迪

and*_*ell 9

我决定将它实现为Ajax表单.

@using(Ajax.BeginForm( 
  "RefreshTestStatus2", 
  "refresh",
  new AjaxOptions { 
    UpdateTargetId = "status", 
    InsertionMode = InsertionMode.InsertBefore }))
{
  <input type="submit" name="submit" value="Link Text" />
}
Run Code Online (Sandbox Code Playgroud)

我认为可以说它不是一个干净的Ajax.ActionLink,但它给你一个输入按钮.