esempio modalpopupExtender
http://www.ajaxtoolkit.net/ModalPopup/ModalPopup.aspx
(uno dei tanti in rete, semplificato)
codice:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="modalPopup.aspx.cs" Inherits="STUDIO2016.ACT_Examples.modalPopup" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ACT" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ModalPopup - Esempio HTML.it</title> <style type="text/css"> .modalBackground { background-color: Black; filter: alpha(opacity=90); opacity: 0.8; } .modalPopup { background-color: #FFFFFF; border-width: 3px; border-style: solid; border-color: black; padding-top: 10px; padding-left: 10px; width: 300px; height: 140px; } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager> <div> <asp:Button ID="btPop" runat="server" Text="Apri la modal popup >>" /> <ACT:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="btPop" CancelControlID="btnClose" BackgroundCssClass="modalBackground"></ACT:ModalPopupExtender> </div> <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" align="center" Style="display: none"> Ciao, oggi è il <%= DateTime.Now.ToShortDateString() %> <br /><br /><br /> <asp:Button ID="btnClose" runat="server" Text="Close" /> </asp:Panel> </form> </body> </html>
nel code-behind c# non c'e' nulla..
PS: devi avere ovviamente aggiunto la componentistica dell'AjaxControlToolkit (puoi scaricare la DLL da molti siti in rete)

Rispondi quotando