UpdatePanel工作时,模态正在关闭。 [英] Modal is closing when UpdatePanel Works.

查看:60
本文介绍了UpdatePanel工作时,模态正在关闭。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个更新面板,其中包含3个下拉列表。这些下拉项目可能会改变取决于第一次下拉。而且我有模态弹出独立这些下拉列表。

但是当我点击按钮并打开模态时页面会回发并且模态快速关闭我怎么能摆脱这个问题。以下是我的代码。



Hi,
I have a update panel which including 3 dropdownlist. and those dropdown items can change depend on first dropdown. and also I have modal popup independent these dropdownlists.
but when I click the button and open modal the page does postback and modal was closing quickly how can I get rid of this issues. and below this my code.

<!--MODAL -->
     <div id="myModalNew" class="modal fade" tabindex="-1" role="dialog">
         <div class="modal-dialog">
             <div class="modal-content">
                 <div class="modal-header">
                     <button type="button" class="close" data-dismiss="modal">×</button>
                </div>
                 <div class="modal-body">
                     //S0me Code

                 </div>
             </div>
         </div>
     </div>

     <!--Basic Form-->
     <asp:UpdatePanel runat="server" ID="updtBrand" UpdateMode="Conditional">
         <ContentTemplate>
             <div class="panel panel-blue margin-bottom-20">
                 <div class="panel-heading">
                     <h3 class="panel-title">xxx</h3>
                 </div>
                 <div class="panel-body">
                     <div class="margin-bottom-40">

                         <div class="form-group col-xs-6 col-sm-4">
                             <label>Marka</label>
                             <asp:DropDownList runat="server" CssClass="form-control" ID="ddlBrand" DataTextField="CarBrand" AutoPostBack="True" OnSelectedIndexChanged="ddlBrand_SelectedIndexChanged" ClientIDMode="Static" />
                         </div>
                         <div class="form-group col-xs-6 col-sm-4">
                             <label>Model</label>
                             <asp:DropDownList runat="server" CssClass="form-control" ID="ddlModel" AutoPostBack="True" OnSelectedIndexChanged="ddlModel_SelectedIndexChanged" ClientIDMode="Static" />
                         </div>
                         <div class="form-group col-xs-6 col-sm-4">
                             <label>Caroser</label>
                             <asp:DropDownList runat="server" CssClass="form-control" ID="ddlKaroser" AutoPostBack="True" ClientIDMode="Static" />
                         </div>

                     </div>
                 </div>
             </div>
             <div class="panel-body">
                 <div class="col-md-4">
                 </div>
                 <div class="col-md-2">
                     <h4>xxxx</h4>
                     <h4>
                         
                             <asp:Label runat="server" ID="lblCampaingBudget"></asp:Label>
                             TL
                         
                     </h4>
                 </div>
                 <div class="col-md-3">
                     <h4 style="font-size: 80%; color: red;">xxx</h4>
                 </div>
                 <div class="col-md-3">
                   <p>
                         <button type="button" onclick="ShowLabel();" class="btn-u btn-u-blue">xxx</button>
                         <button href="#myModalNew" role="button" data-toggle="modal" id="openBtn" class="btn-u btn-u-red">Hayır</button>
                     </p>

                 </div>
             </div>
             <!--End Basic Form-->

         </ContentTemplate>
         <Triggers>
             <asp:AsyncPostBackTrigger ControlID="ddlBrand" EventName="SelectedIndexChanged" />
             <asp:AsyncPostBackTrigger ControlID="ddlModel" EventName="SelectedIndexChanged" />
         </Triggers>
     </asp:UpdatePanel>

推荐答案

这篇关于UpdatePanel工作时,模态正在关闭。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆