开发者

MVC - button to fire an Ajax.ActionLink

开发者 https://www.devze.com 2023-02-17 23:33 出处:网络
@Ajax.ActionLink( \"Link Text\", \"RefreshTest开发者_如何学GoStatus2\", \"refresh\", new AjaxOptions {
@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

精彩评论

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