Click here to Skip to main content
15,896,502 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
i am developing new website...i am new to this and my requireemnt is

i am storing some values from my from in to the datbase.....if value were stored sucesfully then only i will show the pop up with a button in it...if i cllick the button i will go to home page..


please suggest how to implememt these
Posted
Updated 23-Dec-13 1:07am
v2
Comments
Sampath Lokuge 23-Dec-13 6:49am    
What do you mean by a popup ? Is that a Message box or what?
spanner21 23-Dec-13 6:51am    
yes its like "your request has been completed sucesfully"...and then on the same pop up i have on ebutton on which if i click i will got to home page

HI

This might help you..

you can customise the style, text etc..
if any issue, revert back with a comment :)

XML
<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs"
    Inherits="POC.WebForm2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <style type="text/css">
        .Overlay
        {
            position: fixed;
            top: 0px;
            bottom: 0px;
            left: 0px;
            right: 0px;
            overflow: hidden;
            padding: 0;
            margin: 0;
            background-color: #000;
            filter: alpha(opacity=50);
            opacity: 0.5;
            z-index: 1000;
        }

        .PopUpPanel
        {
            position: absolute;
            background-color: white;
            top: 40%;
            left: 30%;
            z-index: 2001;
            padding: 10px;
            min-width: 250px;
            max-width: 250px;
            -moz-box-shadow: 3.5px 4px 5px #000000;
            -webkit-box-shadow: 3.5px 4px 5px #000000;
            box-shadow: 3.5px 4px 5px #000000;
            border-radius: 5px;
            -moz-border-radiux: 5px;
            -webkit-border-radiux: 5px;
            border: 3px solid green;
        }
    </style>
    <script type="text/javascript">

        var closepopup = function () {
            document.getElementById('<%= panelOverlay.ClientID %>').style.visibility = 'hidden';
            document.getElementById('<%= panelPopUpPanel.ClientID %>').style.visibility = 'hidden';
        }



    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Button ID="btnSave" Text="Save" runat="server" OnClick="btnSave_Click" />
    <table cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <asp:Panel ID="panelOverlay" Style="visibility: hidden" runat="server" class="Overlay"
                    Visible="true">
                </asp:Panel>
                <asp:Panel ID="panelPopUpPanel" Style="visibility: hidden" runat="server" class="PopUpPanel"
                    Visible="true">
                    <table width="100%">
                        <tr>
                            <td>
                                your request has been completed sucesfully, click continue to go home page?
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                                <asp:Button ID="btnContinue" OnClientClick="window.location.href = 'home.aspx'; return false;"
                                    Text="Continue" runat="server" />
                                    &nbsp;
                                <asp:Button ID="btnClose" OnClientClick="self.closepopup(); return false" Text="Close"
                                    runat="server" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>





C#
protected void btnSave_Click(object sender, EventArgs e)
       {

           panelOverlay.Style.Add("visibility", "visible");
           panelPopUpPanel.Style.Add("visibility", "visible");

       }
 
Share this answer
 
v2
Comments
spanner21 23-Dec-13 13:50pm    
thanks kartik..but i want cusomised pop up with continue as the button on clicking it i go to home page pls suggest
Karthik_Mahalingam 23-Dec-13 22:41pm    
ok sure, i wil give you the suggestion..
Karthik_Mahalingam 23-Dec-13 23:12pm    
try updated solution.
spanner21 23-Dec-13 23:17pm    
thanks karthik i had a small doubt here what is the difference between overlay panle and pop up panel
Karthik_Mahalingam 23-Dec-13 23:41pm    
that will gives you an effect of modal pop up ... u run this code and check you wil come to know..
Try is as below.

ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('"your request has been completed sucesfully"');", true);


Check for more info : ASP.NET Web Application Message Box
 
Share this answer
 
Comments
spanner21 23-Dec-13 13:48pm    
CAN I CUSTOMISE THE POP UP AS PER MY DESIGN
Sampath Lokuge 24-Dec-13 1:44am    
What's your customization ?
Hi,

Please see the below link. it will show you how to create alert message.

http://www.aspdotnet-suresh.com/2012/04/aspnet-show-alert-message-from-code.html[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900