MVC button to launch Ajax.ActionLink

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

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

Judy

+4
source share
2 answers

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 that it’s not so simple Ajax.ActionLink, but it gives you the enter button.

+9
source

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

for example an example

see also the corresponding question

+2
source

Source: https://habr.com/ru/post/1344616/


All Articles