Click here to Skip to main content
15,893,368 members
Articles / Web Development / ASP.NET

ASP.NET Popup Control

Rate me:
Please Sign up or sign in to vote.
4.87/5 (617 votes)
21 Apr 2004Ms-PL5 min read 3.3M   98.5K   1.2K  
Highly customizable JavaScript popup control for web page wrapped in ASP.NET custom control.
<%@ Register TagPrefix="cc1" Namespace="EeekSoft.Web" Assembly="EeekSoft.Web.PopupWin" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="VbNet.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <title>EeekSoft Popup Window Test - Vb.Net</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
    <meta name=vs_defaultClientScript content="JavaScript">
    <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
  </head>
  <body MS_POSITIONING="GridLayout">

    <form id="Form1" method="post" runat="server"><asp:button id="btnPopup" style="Z-INDEX: 123; LEFT: 120px; POSITION: absolute; TOP: 280px" runat="server" text="Popup"></asp:button><cc1:popupwin id="popupWin" style="Z-INDEX: 124; LEFT: 288px; POSITION: absolute; TOP: 528px" runat="server" width="230px" height="100px" windowsize="300, 200" windowscroll="False" dockmode="BottomLeft" colorstyle="Blue" gradientdark="210, 200, 220" textcolor="0, 0, 3" shadow="125, 90, 160" lightshadow="185, 170, 200" darkshadow="128, 0, 102" visible="False"></cc1:popupwin><cc1:popupwin id="popupWin2" title="Second window" style="Z-INDEX: 114; LEFT: 584px; POSITION: absolute; TOP: 528px" runat="server" text="Text to display in new window. <br><b>This text is from second window...</b>" width="230px" dockmode="BottomRight" gradientdark="225, 225, 208" textcolor="0, 50, 0" shadow="160, 180, 140" lightshadow="208, 221, 195" darkshadow="50, 100, 50" visible="False" actiontype="RaiseEvents" gradientlight="255, 255, 255" message="You can have more than one popup window ! <br/><br/><b>This has custom color scheme</b>" hideafter="8000" offsety="130"></cc1:popupwin><cc1:popupwin id="popupBob" title="Visit CodeProject.Com" style="Z-INDEX: 117; LEFT: 16px; POSITION: absolute; TOP: 528px" runat="server" Width="216px" Visible="False" linktarget="_blank" Link="http://www.codeproject.com" ActionType="OpenLink" DockMode="BottomLeft" Message="<img src=&quot;bob.gif&quot; border=&quot;0&quot; align=&quot;right&quot;><p><b>THE CODE <span style=&quot;color:#00a000;&quot;>PROJECT</span></b><br><br>The Visual Studio Developer's Homepage.</p>" LightShadow="255, 192, 128" Shadow="128, 64, 0" TextColor="0, 0, 0" DarkShadow="0, 0, 0" GradientLight="251, 238, 187" GradientDark="255, 153, 0"></cc1:popupwin><asp:label id="Label1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 16px" runat="server">Text to show:</asp:label><asp:textbox id="textMsg" style="Z-INDEX: 103; LEFT: 120px; POSITION: absolute; TOP: 16px" runat="server" columns="50" width="336px">This text will be displayed in popup window.</asp:textbox><asp:label id="Label2" style="Z-INDEX: 104; LEFT: 16px; POSITION: absolute; TOP: 168px" runat="server">Text to show in info window:</asp:label><asp:textbox id="textFull" style="Z-INDEX: 105; LEFT: 120px; POSITION: absolute; TOP: 192px" runat="server" columns="39" width="336px" rows="4" textmode="MultiLine" height="80px">This very long text will be displayed in new window. To open this window click on &quot;Show Popup&quot; button and then click on popup window.</asp:textbox><asp:textbox id="textTitle" style="Z-INDEX: 107; LEFT: 120px; POSITION: absolute; TOP: 48px" runat="server" columns="50" Width="336px">Title here</asp:textbox><asp:label id="Label3" style="Z-INDEX: 108; LEFT: 16px; POSITION: absolute; TOP: 48px" runat="server" Width="32px">Title:</asp:label><asp:dropdownlist id="clrStyle" style="Z-INDEX: 109; LEFT: 120px; POSITION: absolute; TOP: 80px" runat="server" Width="336px">
<asp:ListItem Value="Red">Red</asp:ListItem>
<asp:ListItem Value="Green">Green</asp:ListItem>
<asp:ListItem Value="Blue" Selected="True">Blue</asp:ListItem>
<asp:ListItem Value="Violet">Violet</asp:ListItem>
</asp:dropdownlist><asp:label id="Label4" style="Z-INDEX: 110; LEFT: 16px; POSITION: absolute; TOP: 80px" runat="server">Color style:</asp:label><asp:button id="btn4Ever" style="Z-INDEX: 111; LEFT: 184px; POSITION: absolute; TOP: 280px" runat="server" Text="No hide"></asp:button><asp:dropdownlist id="popDocking" style="Z-INDEX: 112; LEFT: 120px; POSITION: absolute; TOP: 112px" runat="server" Width="336px">
<asp:ListItem Value="Bottom - Left">Bottom - Left</asp:ListItem>
<asp:ListItem Value="Bottom - Right" Selected="True">Bottom - Right</asp:ListItem>
</asp:dropdownlist><asp:label id="Label5" style="Z-INDEX: 113; LEFT: 16px; POSITION: absolute; TOP: 112px" runat="server">Docking:</asp:label><asp:button id="btnTwo" style="Z-INDEX: 115; LEFT: 256px; POSITION: absolute; TOP: 280px" runat="server" Text="Two popups"></asp:button><asp:button id="btnBob" style="Z-INDEX: 118; LEFT: 368px; POSITION: absolute; TOP: 280px" runat="server" Text="CP Banner"></asp:button><asp:label id="Label6" style="Z-INDEX: 121; LEFT: 16px; POSITION: absolute; TOP: 144px" runat="server">Drag&Drop:</asp:label><asp:DropDownList id="dropDrag" style="Z-INDEX: 122; LEFT: 120px; POSITION: absolute; TOP: 144px" runat="server" Width="336px">
<asp:ListItem Value="Enable Drag&amp;drop" Selected="True">Enable Drag&amp;drop</asp:ListItem>
<asp:ListItem Value="Disable Drag&amp;drop">Disable Drag&amp;drop</asp:ListItem>
</asp:DropDownList>

    </form>

  </body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Czech Republic Czech Republic
I live in Prague, the capital city of Czech republic (most of the time Smile | :) ). I've been very interested in functional programming recently and I have a passion for the new Microsoft F# language. I'm writing a book about Functional Programming in the Real World that shows the ideas using examples in C# 3.0 and F#.

I've been Microsoft MVP (for C#) since 2004 and I'm one of the most active members of the F# community. I'm a computer science student at Charles University of Prague. My hobbies include photography, fractals and of course many things related to computers (except fixing them). My favorite book writers are Terry Pratchett and Philip K Dick and I like paintings by M. C. Escher.

PS: My favorite codeproject icon is Sheep | [baah] .

Comments and Discussions