Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 引导模式触发但不触发ASP按钮单击事件_C#_Asp.net_Twitter Bootstrap_Webforms - Fatal编程技术网

C# 引导模式触发但不触发ASP按钮单击事件

C# 引导模式触发但不触发ASP按钮单击事件,c#,asp.net,twitter-bootstrap,webforms,C#,Asp.net,Twitter Bootstrap,Webforms,基本上就像标题所说的 布局: 页面带有DataGrid和动态数量的按钮 预期功能: 单击其中一个按钮时,将显示模式,然后将触发asp按钮单击事件 从现在起的功能: ASP按钮被单击,模式显示,事件将不会触发 有人知道有没有可能让两个人都开枪 以下是我的观点: div id="example" class="modal hide fade in" style="display: none;"> <div class="modal-header">

基本上就像标题所说的

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

预期功能: 单击其中一个按钮时,将显示模式,然后将触发asp按钮单击事件

从现在起的功能: ASP按钮被单击,模式显示,事件将不会触发

有人知道有没有可能让两个人都开枪

以下是我的观点:

 div id="example" class="modal hide fade in" style="display: none;">
              <div class="modal-header">
                  <a class="close" data-dismiss="modal">x</a>
                  <h3>Enter Comments Below:</h3>
              </div>
              <div class="modal-body">
                  <h4>Comments</h4>                  
              </div>
              <div class="modal-footer">
                  <a href="#" class="btn btn-success">Call to action</a>  
                    <a href="#" class="btn" data-dismiss="modal">Close</a>                   
              </div>
          </div>
以下是单击按钮时显示模式的Jquery:

 <script type="text/javascript">
           $('input[name$="TestButton2"]').on("click", function () {

               $('#example').modal('toggle');
               return false;

           });
     </script>

$('input[name$=“TestButton2”]”)。在(“单击”上,函数(){
$(“#示例”).modal('toggle');
返回false;
});
有人有什么想法吗?我曾经考虑过一个隐藏字段,但不知道它是否真的有效。这可能只是不可能与WebForms,但我想我会问。
提前感谢你的帮助

在按钮上单击ClientScriptManager调用java脚本

protected void TestButton_Click(object sender, EventArgs e)
                    {

                     // do something then call modal
ClientScript.RegisterStartupScript(GetType(), "Show", "<script> $('#example').modal('toggle');</script>");
                    }
protectedvoidtestbutton\u单击(对象发送方,事件参数e)
{
//做点什么然后打电话给莫代尔
RegisterStartupScript(GetType(),“Show”,“$”(“#示例”).modal('toggle');”;
}

在按钮上单击ClientScriptManager调用java脚本

protected void TestButton_Click(object sender, EventArgs e)
                    {

                     // do something then call modal
ClientScript.RegisterStartupScript(GetType(), "Show", "<script> $('#example').modal('toggle');</script>");
                    }
protectedvoidtestbutton\u单击(对象发送方,事件参数e)
{
//做点什么然后打电话给莫代尔
RegisterStartupScript(GetType(),“Show”,“$”(“#示例”).modal('toggle');”;
}
protected void TestButton_Click(object sender, EventArgs e)
                    {

                     // do something then call modal
ClientScript.RegisterStartupScript(GetType(), "Show", "<script> $('#example').modal('toggle');</script>");
                    }