//從 Server 端 控制 Boorstrap Modal

//顯示對話方塊
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closepup", "$('#Modal_ID').modal('show');", true);


//關閉對話視窗本身
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closepup", "$('#Modal_ID').modal('hide');", true);

//關閉需移除body上的class
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closepup", "$('body').removeClass('modal-open');", true);

//關閉須移除遮罩
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closmask", "$('.modal-backdrop').remove();", true);

相关文章