0
コントローラーで
[HttpPost]
public ActionResult UnAssign()
{
ViewBag.Message = courseManager.Updated();
return View();
}
:私はUpdateメソッドで0に私のデータベースの列値の1を更新したいこのコードで
<form method="post">
<input id="btnSubmit" type="submit" value="UnAssign Courses" />
</form>
@section scripts
{
<script>
$("#btnSubmit").click(function(event) {
event.preventDefault();
});
$("#btnSubmit").click(function(event) {
var confirmationmessage = "Are you sure you want to delete this?";
if (! confirm(confirmationmessage)) {
event.preventDefault();
} else {
}
});
</script>
}
私はすでに行わ一緒にクエリを作成しましたデータベースとの接続。私は特定のアクションメソッドを呼び出すことができますし、どのようなモデルや値を渡すことなくこのタスクを行うことができます知っていることを知っている何もしません。
Ajaxポストを使用できます。 – Berkay
'
その部分を変更しましたが、まだ私の提出は私の行動には向かない。私はフォームアクションの呼び出しを試みたが、何もしなかった。 –