使用aspx DetailsView的插入功能。想要在處理新記錄並將其添加到數據庫時顯示JavaScript模式彈出窗口。我可以鉤上DetailsView_ItemCommand中的按鈕。它不工作,所以我開始試圖通過簡單地顯示javascript Alert()彈出窗口來弄清楚發生了什麼。但不能讓這個工作。以下是相關的DetailsView_ItemCommand:將「請稍候」javascript模式添加到aspx DetailView插入按鈕
protected void DetailsViewInsertFPL_ItemCommand(object sender, DetailsViewCommandEventArgs e)
{
if (e.CommandName == "Insert")
{
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "waitMessage", "alert('Please wait while your request is processed');", true);
return;
}
}
插入記錄後,有一個重定向到另一個aspx頁面。
任何人都可以把我引向正確的道路嗎?我將查看旁邊的一些aspx頁面和DetailsView屬性,看看是否有設置不正確。
將'DetailView'放入'asp:UpdatePanel'中並添加'asp:UpdateProgress'。 –
我會給asp:UpdatePanel和asp:UpdateProgress一起去看看它是如何工作的。 – Pete