0
私はAjax.BeginForm
フォームポストを使用しています。Asp.net mvc ajaxもう一度実行中
ボタンをクリックするとすぐに複数のボタンをクリックします。複数の作業を処理する。 RefreshPosts();
スクリプトを実行すると、フォーム要素がリセットされます。
コントローラー:
public string SharePost(FormCollection form)
{
var singleUser = _repUsers.GetUserWithCookie(GetCookie(_set.userCookieName));
string content = Request.Form["statusText"];
_opPosts.AddPost(content, singleUser.UserId);
_opUsers.AddFeed(1, singleUser.UserFirstName, singleUser.UserSurName);
Session["PostDate"] = DateTime.Now;
return "Başarıyla paylaştık." + "<script> refreshPosts(); </script>";
}
ビュー:
@using (Ajax.BeginForm("SharePost", "Post", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "result", OnSuccess = "postSuccess", LoadingElementId = "loading" }))