Bootstrap Modal触发但不触发ASP Button Click事件

基本上就像标题所说的那样。

布局:带有DataGrid的页面和动态数量的按钮。

预期function:当单击其中一个按钮时,将显示模态,然后将触发asp按钮单击事件。

现在的function:单击ASP按钮,模态显示,事件不会触发。

任何人都知道是否有可能同时开火?

这是我的模态:

div id="example" class="modal hide fade in" style="display: none;">    

这是按钮:

  

这是代码Behind中的按钮单击事件。

 protected void TestButton_Click(object sender, EventArgs e) { // This does something } 

这是Jquery,它在单击按钮时显示模态:

   $('input[name$="TestButton2"]').on("click", function () { $('#example').modal('toggle'); return false; });  

有人有主意吗? 我想过一个隐藏的领域,但不知道这是否真的有效。 WebForms可能无法实现,但我想我会问。 在此先感谢您的帮助。

在单击按钮时使用ClientScriptManager调用java脚本

 protected void TestButton_Click(object sender, EventArgs e) { // do something then call modal ClientScript.RegisterStartupScript(GetType(), "Show", ""); }