开发者

MVC - button to fire an Ajax.ActionLink

@Ajax.ActionLink(
    "Link Text", 
    "RefreshTest开发者_如何学GoStatus2", 
    "refresh",
    new AjaxOptions { 
        UpdateTargetId = "status", 
        InsertionMode = InsertionMode.InsertBefore })

But I would like to use something that looks like a submit button to fire it. Does anyone know how to do this?

Judy


I decided to implement it as an Ajax form.

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

I think it's safe to say it's not as clean an Ajax.ActionLink, but gives you an input button.


One option would be to use some css to make the link look like a button

such as this example

also see the related question here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜