Want to be able to close a Modal Popup when clicked outside of it
<p>I have a modal popup extender and a panel inside of an update panel. I do have a Close button which I bind with the CancelControlId. I however, would like to be able to click outside of my modal/panel to close the panel. (instead of using the close button).</p>

<p>I tried a couple things and a plugin clickoutside. Nothing seems to help. Any help or advice is much appreciated. Thanks.</p>

<pre><code>&lt;asp:Content ID="Content3" ContentPlaceHolderID="rightNavigation" runat="server"&gt;
&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;&lt;/asp:ScriptManager&gt;
&lt;div id="mls_title" class="MLS_Title"&gt;
    &lt;asp:Label ID="lblTitle1" Text="Tasks" runat="server" class="MLS_titleLbl" /&gt;&lt;br /&gt;
&lt;/div&gt;
    &lt;asp:UpdatePanel ID="pnlMap" runat="server"&gt;
        &lt;ContentTemplate&gt;
            &lt;div&gt;
                &lt;asp:Button ID="btnMap" runat="server" Text="MAP" CausesValidation="false" CssClass="btnMap" /&gt;
                &lt;ajax:ModalPopupExtender
                    ID="ModalPopupExtender1"
                    runat="server"
                    TargetControlID="btnMap"
                    PopupControlID="panel1"
                    PopupDragHandleControlID="PopupHeader"
                    Drag="true"
                    BackgroundCssClass="ModalPopupBG"&gt;
                &lt;/ajax:ModalPopupExtender&gt;

                &lt;asp:Panel ID="panel1" runat="server"&gt;
                    &lt;div class="popup_large"&gt;
                        &lt;asp:Label ID="Label7" Text="Floor Plan" runat="server" stle="float:left"&gt;&lt;/asp:Label&gt;
                        &lt;asp:ImageButton ID="ImageButton1" runat="server" ToolTip="No" ImageUrl="~/Images/no.png" Style="float: right; margin-right: 20px" /&gt;
                        &lt;br /&gt;
                        &lt;asp:ImageButton ID="img" runat="server" Height="30em" Width="45em" /&gt;
                    &lt;/div&gt;
                &lt;/asp:Panel&gt;

            &lt;/div&gt;
        &lt;/ContentTemplate&gt;
    &lt;/asp:UpdatePanel&gt;
</code></pre>

<p></p>
