You can try this simple trick
On the
clientclick
of the open popup buttton, using javascript you can set the
popup div element style
to be
static
..
note: i have used jquery..
example:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
</style>
<script src="jquery.js.js"></script>
<script type="text/javascript">
$(function () {
$('#Button1').click(function () {
$('.ModalPopupBG').css('position', 'static')
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server"
CancelControlID="btnCancel" OkControlID="btnOkay"
TargetControlID="Button1" PopupControlID="Panel1"
PopupDragHandleControlID="PopupHeader" Drag="true"
BackgroundCssClass="ModalPopupBG">
</asp:ModalPopupExtender>
<asp:Panel ID="Panel1" Style="display: none; height: 300px; width: 300px; background-color: yellow" runat="server">
<div class="HellowWorldPopup">
<div class="PopupHeader" id="PopupHeader">Header</div>
<div class="PopupBody">
<p>This is a simple modal dialog</p>
</div>
<div class="Controls">
<input id="btnOkay" type="button" value="Done" />
<input id="btnCancel" type="button" value="Cancel" />
</div>
</div>
</asp:Panel>
<br />
<asp:Button Text="Click outside popup" runat="server" />
</form>
</body>
</html>