In this Blog we will evaluate ASP.NET ModalPopUp ajax extender control.
Using this control we will show ModalPopUp in pageload & this popup should be shown to user only once during the session i.e. popup should not be shown when page is refreshed and should not be shown after returning back to this page before session expires.
Let's dig into this article by following below steps:
1. As we all know the primary control to be used whenever we use .NET Ajax control. Yes you have guessed it right it's not other than ScriptManager control. Add this to the form
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
2. Next we need ModalPopUp extender control
<asp:ModalPopupExtender runat="server" ID="myExtender" BackgroundCssClass="myModalPopupbackGrnd"
PopupControlID="myPopup" TargetControlID="myhiddencontrol"></asp:ModalPopupExtender>
myExtender:
Modalpopup control ID
myPopup: Name of panel which will be shown as PopUp
myhiddencontrol: Modalpopup extender expects target control ID. Based on this control event extenders are executed. For example if we want popup to shown upon click event these we need to give button control ID. But in our case we want to show popup on page load we will give label ID
3 Now let's add the panel which will be shown as popup
<asp:Panel ID="myPopup" runat="server" CssClass="myModalPopup" Style="display: none;">
<asp:Panel ID="dragHandler" runat="server">
Welcome</asp:Panel>
<div style="padding: 3px;">
This is a demo popup extender
</div>
<div style="width: 500px; text-align: right;">

sibadutta NayakPosted Jun 13, 2019, 4:19 PM
It is not working