MVCの初心者の前にプロンプトをユーザーに警告することができます。MVC +どのように私はここで、コントローラのアクション
私は
私のコード(レコードを更新)コントローラのアクションの前にユーザーに確認を取得したい:
[HttpPost]
public ActionResult JobHandlerUpdate(int jobScheduleId, JobHandlerList jobHandlerList)
{
var updateJobHander = new MainJobHandler();
var item = updateJobHander.GetById(jobScheduleId);
if (ModelState.IsValid)
{
List<string> days = jobHandlerList.JobProcessDayOfWeek.Split(',').ToList();
updateJobHander.Update(item, days);
if(jobHandlerList.MaxInstances == 0)
{
// here I need to prompt user if maxInstances entered is Zero-
Job will be disabled want to processs (Y/N) if yes update
else do nothing or redirect to edit screen
}
return RedirectToAction("JobHandler");
}
return View(item);
}
iはjavascriptのアラートを使用して行う必要がありますか? または良い方法があります。
CGK - あなたはcofimationをしてくださいませコントローラのアクションのいくつかのサンプルを置くことができます。 – Sreedhar