Thursday, May 21, 2026

Website popup in aspx page if open website

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


<!DOCTYPE html>

<html>

<head runat="server">

    <title>Popup Example</title>


    <style>

        /* Background overlay */

        .popup-overlay {

            position: fixed;

            top: 0;

            left: 0;

            width: 100%;

            height: 100%;

            background: rgba(0,0,0,0.6);

            display: flex;

            justify-content: center;

            align-items: center;

            z-index: 9999;

        }


        /* Popup box */

        .popup-box {

            background: white;

            width: 400px;

            padding: 20px;

            border-radius: 10px;

            text-align: center;

            box-shadow: 0px 0px 10px gray;

        }


        .popup-box h2 {

            color: #0d6efd;

        }


        .close-btn {

            background: red;

            color: white;

            border: none;

            padding: 10px 20px;

            cursor: pointer;

            border-radius: 5px;

        }


        .admission-btn {

            background: green;

            color: white;

            padding: 10px 20px;

            text-decoration: none;

            border-radius: 5px;

            display: inline-block;

            margin-top: 10px;

        }

    </style>


    <script>

        // Show popup when page opens

        window.onload = function () {

            document.getElementById("popup").style.display = "flex";

        }


        // Close popup

        function closePopup() {

            document.getElementById("popup").style.display = "none";

        }

    </script>


</head>

<body>


    <form id="form1" runat="server">


        <!-- Popup -->

        <div id="popup" class="popup-overlay">


            <div class="popup-box">

                <h2>Admission Open 2026</h2>


                <p>

                    Join NRsolution4u Training Programs

                </p>


                <a href="Admission.aspx" class="admission-btn">

                    Apply Now

                </a>


                <br /><br />


                <button type="button" class="close-btn" onclick="closePopup()">

                    Close

                </button>

            </div>


        </div>


    </form>


</body>

</html>

No comments:

Post a Comment

Website popup in aspx page if open website

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %...