Click here to Skip to main content
15,893,790 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

ASP.NET
       <!--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>
                                ^__b>
                                    <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>


Posted
Comments
Ahmed Bensaid 31-May-14 13:20pm    
Try adding onclick="return false" to your button ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900