I am able to display the modal popup using the following code
<asp:scriptmanager id="ScriptManager1" runat="server">
</asp:scriptmanager>
<asp:button id="Button1" runat="server" text="Button" />
<cc1:modalpopupextender id="ModalPopupExtender1" runat="server"
cancelcontrolid="btnCancel" okcontrolid="btnOkay"
targetcontrolid="Button1" popupcontrolid="Panel1"
popupdraghandlecontrolid="PopupHeader" drag="true"
backgroundcssclass="ModalPopupBG">
</cc1:modalpopupextender>
<asp:panel id="Panel1" style="display: none" 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>
But I need to keep the page active and let the users to keep making selections on the page without closing the modal popup. Is this possible?
Appreciate any help.
2
Answers
I am able to achieve my goal with the following link. Thank you
https://www.aspdotnet-suresh.com/2013/10/jquery-floating-div-on-page-scroll.html
I don’t believe that the modal dialog from the AJ toolkit allows this.
While I have in the past used the modal dialog from the AJ toolkit, the lack of being able to position the dialog on the screen where I want was over time became a deal breaker.
The only real bonus points of using that AJ Toolkit popup is not having to write any JavaScript.
Other then not having to write JavaScript, over time I moved over to the jQuery.UI dialog due to additional features.
The jQuery.UI dialog works better then the AJ Toolkit one, and even works better then the bootstrap dialog and does so with less markup.
Only real downside of the jQuery.UI dialog is by default it looks like something from the early 2000 web days style wise (it looks poor).
However, with a bit of CSS work, it comes out nice.
The jQuery.UI dialog also supports drag around on the page better then does the AJ Toolkit dialog.
Your question here is thus another example and reason why going with the jQuery.UI dialog is a better choice.
The jQuery.UI dialog has both "modal" = true/false setting, ideal for this question.
Hence this example and markup:
Markup:
And the result is this:
Note how I can freely open, close, move around the dialog, and am freely able to edit text in the popup, or edit + use any other control on the existing page.
Edit: jQuery and jQuery.UI via CDN
So, to reference jQuery and jQuery.UI, hence this :
And then your .dialog call looks like this:
Now, I like this shadow class somewhat better and is the one I used for this code:
The above results in this:
So, I "hide" the "x" to close in the upper right corner. If you remove this:
Then you get this: