2015-11-03 68 views
0

我有一個包含HTML表單的Bootstrap模式。現在,在提交按鈕單擊窗體的事件,我需要重新加載(刷新)的網頁。我沒有使用Ajax,我的服務器端代碼正從表單的形式行動method.How稱爲重新加載網頁,在這種情況下?..這是我的HTML ..沒有Ajax Reload表單提交網頁提交

<div class="modal fade" id="StudentModal" tabindex="-1" role="dialog" aria-labelledby="StudentModalLabel" aria-hidden="true" data-backdrop="static"> 
<div class="modal-dialog"> 
<div class="modal-content"> 
<form action="~/GetStudent" class="form-horizontal" role="form" method="post" id="frmStudent"> 
    <div class="modal-footer"> 
     <div class="pull-right"> 
      <button type="submit" class="btn btn-success" id="save" data-dismiss="modal"><i class="glyphicon glyphicon-ok"></i> Save</button> 
      <button type="button" class="btn btn-danger" data-dismiss="modal"><i class="glyphicon glyphicon-remove"></i> Close</button> 
     </div> 
    </div> 
</form> 

這裏是我的提交按鈕單擊事件..

$('#save').on('click', function() { 
    $("#frmStudent").submit(); 
}); 

請幫我把它done..Thanks ..

+1

首先,你不需要點擊處理程序,因爲'type ='submit''會爲你做。要重新加載頁面,一旦服務器端表單處理完成,將用戶重定向到頁面上! – Rayon

+0

@RayonDabre帶出單擊處理程序我的模態窗體沒有關閉.. – Lara

+0

您的意思是表單沒有被提交?這不應該發生,除非有一些腳本阻止它。 – Rayon

回答

-1

試試這個:

$('#frmStudent').submit(function() { 

    // Do your stuff here (on form Submit) 

});