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

ASP.Net User Controls as Static or Movable PopUps

Rate me:
Please Sign up or sign in to vote.
4.63/5 (21 votes)
2 Feb 2007CPOL2 min read 110.6K   2.8K   103  
Use form controls as static informational popups or movable control windows.
namespace CarboniSoftware.PopExample
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;

	/// <summary>
	///		PopUpHelp is a simple control that holds text or HTML to display as a popup
	///		window.  PopUpHelp must be positioned absolute and initially hidden.
	/// </summary>
	public class PopUpHelp : System.Web.UI.UserControl
	{

		protected System.Web.UI.HtmlControls.HtmlGenericControl PopUp;

		public string PopUpID = "tempID";
		public string PopUpText = "POP!";
		public string PopUpClass = "ipopuptxt";

		public void SetPopUpID(string ID)
		{
			PopUpID = ID;
		}

		public void SetPopUpText(string Text)
		{
			PopUpText = Text;
		}

		public void SetPopUpClass(string Class)
		{
			PopUpClass = Class;
		}

		private void Page_Load(object sender, System.EventArgs e)
		{
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.Load += new System.EventHandler(this.Page_Load);
		}
		#endregion
	}
}

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 Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Software architect and developer with over 20 years of experience, specializing in GUI designs and intranet systems in MFC/C++ and ASP.Net using C#.

Comments and Discussions