0

サーバーに投稿する必要がある Html.ActionLink があります。

@Html.ActionLink("Some Text", "controller", "service", Model, new { @class = "btn btn-primary", @id = "someText" })

これをAJAX投稿に変えてみました:

@Ajax.ActionLink("Some Text", "controller", "service", Model, new { @class = "btn btn-primary", @id = "someText" }, new AjaxOptions(){HttpMethod = "POST"})

上記の Html.Actionlink のような文字列、文字列、文字列、オブジェクト、オブジェクトのオーバーロードはありません。

私は AJAX にあまり詳しくありませんが、AJAX に同じデータを渡すように指示する方法はありますか?

4

1 に答える 1

1

パラメータの順序が間違っているようです。属性のAjaxOptions前に来ます。

@Ajax.ActionLink("Some Text", "controller", "service", Model, new AjaxOptions(){HttpMethod = "POST"}, new { @class = "btn btn-primary", @id = "someText" })
于 2012-10-05T19:40:48.427 に答える