2012-08-14 56 views
2

我有一個自定義表單,我想在我的提交按鈕中添加一些功能。當我點擊提交按鈕時,我想關閉彈出窗口並刷新父頁面。點擊Sharepoint自定義表單中的提交按鈕關閉彈出式模式對話框

我在我的按鈕中使用了這段代碼,但有一個問題。它不會驗證控件,它會進行回發,甚至不保存任何數據。

OnClientClick="javascript:window.frameElement.commitPopup();" 

你能幫我一些工作代碼嗎?

謝謝。

回答

2

您需要在想要執行的代碼後設置OnClientClick屬性。

protected void btnAdd_Click(object sender, EventArgs e) 
    { 

       //Your Code here(some functionality) 

       Context.Response.Write(@"<script type='text/javascript'>window.frameElement.commitPopup(); return false</script>"); 
       Context.Response.Flush(); 
       Context.Response.End(); 
    } 
相關問題