---
title: "Why when I click Dropdown list bootstrap modal is closing"  
description: "Why when I click Dropdown list bootstrap modal is closing"  
author: "chandrashekhar Patil"  
published: 2016-06-29  
updated: 2016-06-29  
canonical: https://www.mindstick.com/forum/34149/why-when-i-click-dropdown-list-bootstrap-modal-is-closing  
category: "asp.net"  
tags: ["bootstrap modal"]  
reading_time: 4 minutes  

---

# Why when I click Dropdown list bootstrap modal is closing

Hi,\
i am using [bootstrap modal](https://www.mindstick.com/forum/33715/need-code-for-crud-operations-using-jquery-ajax-and-bootstrap-modal-popup-using-asp-dot-net-mvc) and in modal i am using [dropdownlist](https://www.mindstick.com/articles/324837/how-to-bind-dropdownlist-in-mvc-core-from-database-using-entity-framework). But Wheni [click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) dropdownlist the modal is going [close](https://yourviews.mindstick.com/story/1687/rubbing-hands-close-up-benefits). i could not complete my [entry](https://www.mindstick.com/interview/531/how-to-delete-an-array-entry-using-javascript) [form](https://www.mindstick.com/forum/6/multi-form-mfc-application).\

```
 <asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional">        <Triggers>            <asp:PostBackTrigger ControlID="bSave" />            <asp:PostBackTrigger ControlID="bNewComment" />            <asp:PostBackTrigger ControlID="btnShowPopup" />            <asp:PostBackTrigger ControlID="ddlEditTypeOfLand" />        </Triggers>        <ContentTemplate>            <asp:Button ID="btnShowPopup" runat="server" Text="Open Modal" class="btn btn-primary btn-lg" />            <div id="myModal" class="modal fade" data-backdrop="static" data-keyboard="false"                role="dialog">                <div class="modal-dialog">                    <div class="modal-content">                        <div class="modal-header">                            <h4 class="modal-title">                                Confirmation</h4>                        </div>                        <div class="modal-body">                            <div class="row">                                <div class="col-sm-6 form-group">                                    <b>Comments</b>                                    <asp:Button ID="bNewComment" CssClass="btn btn-info" Text="Add Comment" runat="server"                                        OnClick="bNewComment_Click" OnClientClick="showComment();" />                                </div>                            </div>                            <div class="row" id="dComment" runat="server" style="display: none;">                                <div class="col-sm-6 form-group">                                    <b>Comments</b>                                    <asp:TextBox ID="tbComment" TextMode="MultiLine" Width="500px" runat="server" placeholder="Enter Comments.."                                        class="form-control"></asp:TextBox>                                </div>                            </div>                            <div class="col-sm-5 form-group">                                <b>Type Of Land</b><span style="color: Red; font-weight: bolder; font-size: medium;">*</span>                                <asp:DropDownList ID="ddlEditTypeOfLand" AutoPostBack="true" runat="server" class="form-control"                                    OnSelectedIndexChanged="ddlEditTypeOfLand_SelectedIndexChanged">                                    <asp:ListItem Value="0" Selected="True"><---Select---></asp:ListItem>                                    <asp:ListItem Value="1">Wasted Land</asp:ListItem>                                </asp:DropDownList>                            </div>                        </div>                        <div class="modal-footer">                            <asp:Button ID="bClose" runat="server" CssClass="btn btn-primary" data-dismiss="modal"                                Text="Close" />                            <asp:Button ID="bSave" runat="server" CssClass="btn btn-primary" Text="Save" OnClick="bSave_Click" />                        </div>                    </div>                </div>            </div>        </ContentTemplate>    </asp:UpdatePanel>
```

\
**[Code behind](https://www.mindstick.com/forum/2199/call-javascript-s-function-from-code-behind)**

```
========= protected void ddlEditTypeOfLand_SelectedIndexChanged(object sender, EventArgs e)    {        try        {            this.GetCustomerList();        }        catch (Exception ex)        {                        throw ex;        }    }
```


---

Original Source: https://www.mindstick.com/forum/34149/why-when-i-click-dropdown-list-bootstrap-modal-is-closing

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
