<i id='ip4AT'><tr id='ip4AT'><dt id='ip4AT'><q id='ip4AT'><span id='ip4AT'><b id='ip4AT'><form id='ip4AT'><ins id='ip4AT'></ins><ul id='ip4AT'></ul><sub id='ip4AT'></sub></form><legend id='ip4AT'></legend><bdo id='ip4AT'><pre id='ip4AT'><center id='ip4AT'></center></pre></bdo></b><th id='ip4AT'></th></span></q></dt></tr></i><div id='ip4AT'><tfoot id='ip4AT'></tfoot><dl id='ip4AT'><fieldset id='ip4AT'></fieldset></dl></div>
        <tfoot id='ip4AT'></tfoot>
        • <bdo id='ip4AT'></bdo><ul id='ip4AT'></ul>
      1. <small id='ip4AT'></small><noframes id='ip4AT'>

      2. <legend id='ip4AT'><style id='ip4AT'><dir id='ip4AT'><q id='ip4AT'></q></dir></style></legend>

        引导模式内的 ASP.NET 按钮未触发单击事件

        时间:2023-10-06
          <tbody id='9OtoT'></tbody>

        <i id='9OtoT'><tr id='9OtoT'><dt id='9OtoT'><q id='9OtoT'><span id='9OtoT'><b id='9OtoT'><form id='9OtoT'><ins id='9OtoT'></ins><ul id='9OtoT'></ul><sub id='9OtoT'></sub></form><legend id='9OtoT'></legend><bdo id='9OtoT'><pre id='9OtoT'><center id='9OtoT'></center></pre></bdo></b><th id='9OtoT'></th></span></q></dt></tr></i><div id='9OtoT'><tfoot id='9OtoT'></tfoot><dl id='9OtoT'><fieldset id='9OtoT'></fieldset></dl></div>
      3. <small id='9OtoT'></small><noframes id='9OtoT'>

        1. <legend id='9OtoT'><style id='9OtoT'><dir id='9OtoT'><q id='9OtoT'></q></dir></style></legend>
            <tfoot id='9OtoT'></tfoot>

                  <bdo id='9OtoT'></bdo><ul id='9OtoT'></ul>
                  本文介绍了引导模式内的 ASP.NET 按钮未触发单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在我的 asp.net 站点中使用 Bootstrap 模态,模态工作正常,但模态页脚内的按钮 btnSaveImage 没有触发点击事件,我也有一个母版页,并且其中包含表单标签.

                  这是我的代码:

                   <a href="#dvUpload"数据切换=模态"><asp:Button runat=服务器"ID =lnkUploadPics";CssClass="btn-大型 Greengradiant"宽度=100%"text="上传图片"></asp:Button></a>

                  <h3 id=myModalLabel">上传图片</h3></div><div 类=模态体"><div 类=行流体"style="padding-left: 10px;padding-right: 10px;padding-bottom: 20px;">

                  解决方案

                  您可以像在示例中一样使用 ASP 按钮

                  <div class="modal-footer"><button data-dismiss="modal" class="btn btn-large">关闭</按钮><asp:Button runat="server" ID="btnSaveImage" Text="Save Image" CssClass="Greengradiant btn- large" OnClick="btnSaveImage_Click"/></div>

                  只需尝试 UseSubmitBehavior="false" 就像所说的 skhurams 并将其与 data-dismiss="modal" 结合使用

                  <div class="modal-footer"><button data-dismiss="modal" class="btn btn-large">关闭</按钮><asp:Button runat="server" ID="btnSaveImage" Text="Save Image" CssClass="Greengradiant btn- large" OnClick="btnSaveImage_Click" UseSubmitBehavior="false" data-dismiss="modal"/></div>

                  这将关闭模态并触发回发

                  I'm working in Bootstrap modal in my asp.net site, modal is working fine but the button btnSaveImage inside modal footer is not firing click event, I also have a masterpage and the form tag is in it.

                  Here is my code:

                   <a href="#dvUpload" data-toggle="modal">
                     <asp:Button runat="server" ID="lnkUploadPics" CssClass=" btn-large Greengradiant"
                                                      Width="100%" Text="Upload pictures"></asp:Button>
                     </a>
                     <div id="dvUpload" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"  aria-hidden="true">
                       <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                           ×</button>
                          <h3 id="myModalLabel">
                               Upload Image</h3>
                             </div>
                               <div class="modal-body">
                              <div class="row-fluid" style="padding-left: 10px; padding-right: 10px; padding-bottom: 20px;"> 
                  <div id="Upload" class="span6">
                          <asp:FileUpload ID="fuImage" runat="server" />
                         <img id="imgUPload" runat="server" src="" />
                                </div>
                               </div>
                              </div>
                            <div class="modal-footer">
                             <button data-dismiss="modal" class="btn  btn-large"> Close</button>
                             <asp:Button runat="server" ID="btnSaveImage" Text="Save Image" CssClass="Greengradiant btn-large" OnClick="btnSaveImage_Click" />
                              </div>
                           </div>
                  

                  解决方案

                  You can use the ASP Button like in your example

                  <div class="modal-footer">
                     <button data-dismiss="modal" class="btn  btn-large"> Close</button>
                     <asp:Button runat="server" ID="btnSaveImage" Text="Save Image" CssClass="Greengradiant btn- large" OnClick="btnSaveImage_Click" />
                  </div>
                  

                  just try the UseSubmitBehavior="false" like said skhurams and combine it with the data-dismiss="modal"

                  <div class="modal-footer">
                     <button data-dismiss="modal" class="btn  btn-large"> Close</button>
                     <asp:Button runat="server" ID="btnSaveImage" Text="Save Image" CssClass="Greengradiant btn- large" OnClick="btnSaveImage_Click" UseSubmitBehavior="false" data-dismiss="modal" />
                  </div>
                  

                  this will close the modal and trigger the postback

                  这篇关于引导模式内的 ASP.NET 按钮未触发单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    <i id='Reo4t'><tr id='Reo4t'><dt id='Reo4t'><q id='Reo4t'><span id='Reo4t'><b id='Reo4t'><form id='Reo4t'><ins id='Reo4t'></ins><ul id='Reo4t'></ul><sub id='Reo4t'></sub></form><legend id='Reo4t'></legend><bdo id='Reo4t'><pre id='Reo4t'><center id='Reo4t'></center></pre></bdo></b><th id='Reo4t'></th></span></q></dt></tr></i><div id='Reo4t'><tfoot id='Reo4t'></tfoot><dl id='Reo4t'><fieldset id='Reo4t'></fieldset></dl></div>
                  • <legend id='Reo4t'><style id='Reo4t'><dir id='Reo4t'><q id='Reo4t'></q></dir></style></legend>

                      <bdo id='Reo4t'></bdo><ul id='Reo4t'></ul>
                      • <small id='Reo4t'></small><noframes id='Reo4t'>

                        <tfoot id='Reo4t'></tfoot>

                              <tbody id='Reo4t'></tbody>