我試圖在用戶在表單中保存數據時顯示下面的div(通過fadeIn/fadeOut)。成功開機自檢後顯示jQuery淡入淡出
// Display a notification if the save is successful.
$('<div class="save-alert">The current scenario has been saved.</div>')
.insertAfter($('#main'))
.fadeIn('slow')
.animate({ opacity: 1.0 }, 3000)
.fadeOut('slow', function() {
$(this).remove();
});
目前,我使用Html.BeginForm助手提交表單。因此,我的整個頁面都已發佈,而且我無法顯示上述通知。我意識到我可以使用Ajax.BeginForm,但後來遇到了其他問題(即,在保存場景後無法執行return RedirectToAction("Index", new { id = scenario.ScenarioID });
)。
有沒有人對我可以嘗試做的其他事情有任何建議?
這就是Ajax.BeginForm所做的。 – 2011-01-20 21:38:30