ModalPopUp Using CSS & Div To Reduce the Weight On WebPage
Description:
1) ShowSuccessDiv - To PopUp the Div with CSS
2)CloseAlertSuccess - To Close the Div
CSS:
CSS & Div Full fills the Requirement of ModalPopUp Control in Ajax there by we can reduce the weight on the webpage lets see how the code flows.
DivPopUp.aspx:
Here I am using 2 javascript functions names
CSS:
.white_content { display: none; position: absolute; top: 25%; left: 35%; width: 35%; padding: 0px; background-color: white; z-index: 1002; overflow: auto; } .black_overlay { display: none; position: absolute; top: 0%; left: 0%; width: 120em; height: 1000px; background-color: black; z-index: 1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } |
Javascript:
Call the ShowSuccessDiv function where u want to show the popup here I am showing on the link button click as follows.
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="DivModalPopUp.aspx.cs" Inherits="DivModalPopUp" %> <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server"> <script type="text/javascript"> function ShowSuccessDiv() { document.getElementById('Light').style.display = 'block'; document.getElementById('Fade').style.display = 'block'; } function CloseAlertSuccess() { document.getElementById('Light').style.display = 'none'; document.getElementById('Fade').style.display = 'none'; } </script> <div id="Light" class="white_content"> <table cellpadding="0" cellspacing="0" border="0" style="background-color: skyblue;" width="40%"> <tr> <td height="16px" style="padding-right: 3px; padding-top: 2px;"> <a href="#" onclick="javascript:CloseAlertSuccess()"> <img src="Image/cross.png" style="border: 0px" width="13px" align="right" height="13px" /></a> </td> </tr> <tr> <td style="padding-left: 16px; padding-right: 16px; padding-bottom: 16px"> <table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color: #fff" width="100%"> <tr> <td align="center" colspan="2" class="headertext"> Error Validation </td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"> <asp:Label ID="lblError" runat="server" CssClass="error"></asp:Label> </td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"> <asp:Label ID="lblmessage" runat="server" Text="Please Enter UserName"></asp:Label> </td> </tr> <tr> <td> </td> </tr> </table> </td> </tr> </table> </div> <div id="Fade" class="black_overlay"> </div> <asp:LinkButton ID="lnkpoup" runat="server" OnClientClick="javascript:return ShowSuccessDiv();" Text="PopUp"></asp:LinkButton> </asp:Content> |
Subscribe to:
Post Comments (Atom)
Labels
- Abstraction in Object Oriented Programming (OOPS) Concept (1)
- Access ChildControls in Gridview using Javascript (1)
- Add a WCF Service Reference to the Client (1)
- ASP.Net GridView Highlight Row onmouseover (1)
- ASP.NET View State And ViewStateEncryptionModes Overview (1)
- Calling Javascript From Any Part Of Code Behind Page By Registering The Script (1)
- Check And UnCheck CheckBoxes In Gridview using javascript (1)
- contact your server administrator. (1)
- DataControlField class (1)
- DataKeys ID (Identity Column) in Child Controls events in GridView (1)
- DataList Paging With PagedDataSource (1)
- Declaring Session in Asp.Net (1)
- Difference between Struct and Class (1)
- Displaying Images In GridView From DataBase (1)
- Dynamic Sitemaps in ASP.NET (1)
- Err: You must install Office SharePoint Server 2007 – Please read Microsoft Knowledge Base article: 962935 with the most recent service pack (1)
- GridView Class (1)
- Gridview Inside GridView (1)
- Gridview Paging using C# (1)
- Gridview Sorting Using C# (1)
- GridView.RowDataBound EventEvent (1)
- GridViewRow (1)
- Inserting Images To Database And Display in GridView (1)
- Microsoft Office Sharepoint Server 2007 on Windows Server 2008 – This Program is blocked due to compatibility issues (1)
- ModalPopUp Using CSS and Div To Reduce the Weight On WebPage (1)
- Session State in Asp.Net OverView (1)
- SharePoint 2010 – The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information (1)
- Tooltip GridView Header (1)
- Tree View Menu Control (1)
- WCF Service (12)
- What is Encapsulation in OOPS? (1)
Topics
- Abstraction in Object Oriented Programming (OOPS) Concept (1)
- Access ChildControls in Gridview using Javascript (1)
- Add a WCF Service Reference to the Client (1)
- ASP.Net GridView Highlight Row onmouseover (1)
- ASP.NET View State And ViewStateEncryptionModes Overview (1)
- Calling Javascript From Any Part Of Code Behind Page By Registering The Script (1)
- Check And UnCheck CheckBoxes In Gridview using javascript (1)
- contact your server administrator. (1)
- DataControlField class (1)
- DataKeys ID (Identity Column) in Child Controls events in GridView (1)
- DataList Paging With PagedDataSource (1)
- Declaring Session in Asp.Net (1)
- Difference between Struct and Class (1)
- Displaying Images In GridView From DataBase (1)
- Dynamic Sitemaps in ASP.NET (1)
- Err: You must install Office SharePoint Server 2007 – Please read Microsoft Knowledge Base article: 962935 with the most recent service pack (1)
- GridView Class (1)
- Gridview Inside GridView (1)
- Gridview Paging using C# (1)
- Gridview Sorting Using C# (1)
- GridView.RowDataBound EventEvent (1)
- GridViewRow (1)
- Inserting Images To Database And Display in GridView (1)
- Microsoft Office Sharepoint Server 2007 on Windows Server 2008 – This Program is blocked due to compatibility issues (1)
- ModalPopUp Using CSS and Div To Reduce the Weight On WebPage (1)
- Session State in Asp.Net OverView (1)
- SharePoint 2010 – The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information (1)
- Tooltip GridView Header (1)
- Tree View Menu Control (1)
- WCF Service (12)
- What is Encapsulation in OOPS? (1)
0 Responses to “ModalPopUp Using CSS & Div To Reduce the Weight On WebPage”
Post a Comment