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

FrameControl - Framework for creating web applications

Rate me:
Please Sign up or sign in to vote.
2.88/5 (8 votes)
25 Jul 20033 min read 83.2K   40  
FrameControl is a framework that contains the code common for most of the web applications.
  • framecontrol_demo.zip
    • doc
      • banner.htm
      • banner.jpg
      • CodeCommentReportError.htm
      • commentreport.css
      • darkcorner.jpg
      • FrameControl1
        • CWP0.HTM
        • CWP10.HTM
        • CWP100.HTM
        • CWP101.HTM
        • CWP102.HTM
        • CWP103.HTM
        • CWP104.HTM
        • CWP105.HTM
        • CWP106.HTM
        • CWP107.HTM
        • CWP108.HTM
        • CWP109.HTM
        • CWP11.HTM
        • CWP110.HTM
        • CWP111.HTM
        • CWP112.HTM
        • CWP113.HTM
        • CWP114.HTM
        • CWP115.HTM
        • CWP116.HTM
        • CWP117.HTM
        • CWP118.HTM
        • CWP119.HTM
        • CWP12.HTM
        • CWP120.HTM
        • CWP121.HTM
        • CWP122.HTM
        • CWP123.HTM
        • CWP124.HTM
        • CWP125.HTM
        • CWP126.HTM
        • CWP127.HTM
        • CWP128.HTM
        • CWP129.HTM
        • CWP13.HTM
        • CWP130.HTM
        • CWP131.HTM
        • CWP132.HTM
        • CWP133.HTM
        • CWP134.HTM
        • CWP135.HTM
        • CWP136.HTM
        • CWP137.HTM
        • CWP138.HTM
        • CWP139.HTM
        • CWP14.HTM
        • CWP140.HTM
        • CWP15.HTM
        • CWP16.HTM
        • CWP17.HTM
        • CWP18.HTM
        • CWP19.HTM
        • CWP2.HTM
        • CWP20.HTM
        • CWP21.HTM
        • CWP22.HTM
        • CWP23.HTM
        • CWP24.HTM
        • CWP25.HTM
        • CWP26.HTM
        • CWP27.HTM
        • CWP28.HTM
        • CWP29.HTM
        • CWP3.HTM
        • CWP30.HTM
        • CWP31.HTM
        • CWP32.HTM
        • CWP33.HTM
        • CWP34.HTM
        • CWP35.HTM
        • CWP36.HTM
        • CWP37.HTM
        • CWP38.HTM
        • CWP39.HTM
        • CWP4.HTM
        • CWP40.HTM
        • CWP41.HTM
        • CWP42.HTM
        • CWP43.HTM
        • CWP44.HTM
        • CWP45.HTM
        • CWP46.HTM
        • CWP47.HTM
        • CWP48.HTM
        • CWP49.HTM
        • CWP5.HTM
        • CWP50.HTM
        • CWP51.HTM
        • CWP52.HTM
        • CWP53.HTM
        • CWP54.HTM
        • CWP55.HTM
        • CWP56.HTM
        • CWP57.HTM
        • CWP58.HTM
        • CWP59.HTM
        • CWP6.HTM
        • CWP60.HTM
        • CWP61.HTM
        • CWP62.HTM
        • CWP63.HTM
        • CWP64.HTM
        • CWP65.HTM
        • CWP66.HTM
        • CWP67.HTM
        • CWP68.HTM
        • CWP69.HTM
        • CWP7.HTM
        • CWP70.HTM
        • CWP71.HTM
        • CWP72.HTM
        • CWP73.HTM
        • CWP74.HTM
        • CWP75.HTM
        • CWP76.HTM
        • CWP77.HTM
        • CWP78.HTM
        • CWP79.HTM
        • CWP8.HTM
        • CWP80.HTM
        • CWP81.HTM
        • CWP82.HTM
        • CWP83.HTM
        • CWP84.HTM
        • CWP85.HTM
        • CWP86.HTM
        • CWP87.HTM
        • CWP88.HTM
        • CWP89.HTM
        • CWP9.HTM
        • CWP90.HTM
        • CWP91.HTM
        • CWP92.HTM
        • CWP93.HTM
        • CWP94.HTM
        • CWP95.HTM
        • CWP96.HTM
        • CWP97.HTM
        • CWP98.HTM
        • CWP99.HTM
        • FrameControl1.HTM
      • gradleft.jpg
      • gradtop.jpg
      • graycorner.jpg
      • minus.jpg
      • plus.jpg
      • Solution_FrameControl1.HTM
      • titletile.jpg
      • vt.js
    • FrameControl1.dll
    • readme.txt
  • framecontrol_src.zip
    • ActionClass.cs
    • ActionClassContainer.cs
    • ApplicationTransit.cs
    • AssemblyInfo.cs
    • BaseControl.cs
    • CryptoDecrypt.cs
    • DispatchRequest.cs
    • DisplayCentral.cs
    • banner.htm
    • banner.jpg
    • CodeCommentReportError.htm
    • commentreport.css
    • darkcorner.jpg
    • CWP0.HTM
    • CWP10.HTM
    • CWP100.HTM
    • CWP101.HTM
    • CWP102.HTM
    • CWP103.HTM
    • CWP104.HTM
    • CWP105.HTM
    • CWP106.HTM
    • CWP107.HTM
    • CWP108.HTM
    • CWP109.HTM
    • CWP11.HTM
    • CWP110.HTM
    • CWP111.HTM
    • CWP112.HTM
    • CWP113.HTM
    • CWP114.HTM
    • CWP115.HTM
    • CWP116.HTM
    • CWP117.HTM
    • CWP118.HTM
    • CWP119.HTM
    • CWP12.HTM
    • CWP120.HTM
    • CWP121.HTM
    • CWP122.HTM
    • CWP123.HTM
    • CWP124.HTM
    • CWP125.HTM
    • CWP126.HTM
    • CWP127.HTM
    • CWP128.HTM
    • CWP129.HTM
    • CWP13.HTM
    • CWP130.HTM
    • CWP131.HTM
    • CWP132.HTM
    • CWP133.HTM
    • CWP134.HTM
    • CWP135.HTM
    • CWP136.HTM
    • CWP137.HTM
    • CWP138.HTM
    • CWP139.HTM
    • CWP14.HTM
    • CWP140.HTM
    • CWP141.HTM
    • CWP142.HTM
    • CWP143.HTM
    • CWP144.HTM
    • CWP145.HTM
    • CWP146.HTM
    • CWP147.HTM
    • CWP15.HTM
    • CWP16.HTM
    • CWP17.HTM
    • CWP18.HTM
    • CWP19.HTM
    • CWP2.HTM
    • CWP20.HTM
    • CWP21.HTM
    • CWP22.HTM
    • CWP23.HTM
    • CWP24.HTM
    • CWP25.HTM
    • CWP26.HTM
    • CWP27.HTM
    • CWP28.HTM
    • CWP29.HTM
    • CWP3.HTM
    • CWP30.HTM
    • CWP31.HTM
    • CWP32.HTM
    • CWP33.HTM
    • CWP34.HTM
    • CWP35.HTM
    • CWP36.HTM
    • CWP37.HTM
    • CWP38.HTM
    • CWP39.HTM
    • CWP4.HTM
    • CWP40.HTM
    • CWP41.HTM
    • CWP42.HTM
    • CWP43.HTM
    • CWP44.HTM
    • CWP45.HTM
    • CWP46.HTM
    • CWP47.HTM
    • CWP48.HTM
    • CWP49.HTM
    • CWP5.HTM
    • CWP50.HTM
    • CWP51.HTM
    • CWP52.HTM
    • CWP53.HTM
    • CWP54.HTM
    • CWP55.HTM
    • CWP56.HTM
    • CWP57.HTM
    • CWP58.HTM
    • CWP59.HTM
    • CWP6.HTM
    • CWP60.HTM
    • CWP61.HTM
    • CWP62.HTM
    • CWP63.HTM
    • CWP64.HTM
    • CWP65.HTM
    • CWP66.HTM
    • CWP67.HTM
    • CWP68.HTM
    • CWP69.HTM
    • CWP7.HTM
    • CWP70.HTM
    • CWP71.HTM
    • CWP72.HTM
    • CWP73.HTM
    • CWP74.HTM
    • CWP75.HTM
    • CWP76.HTM
    • CWP77.HTM
    • CWP78.HTM
    • CWP79.HTM
    • CWP8.HTM
    • CWP80.HTM
    • CWP81.HTM
    • CWP82.HTM
    • CWP83.HTM
    • CWP84.HTM
    • CWP85.HTM
    • CWP86.HTM
    • CWP87.HTM
    • CWP88.HTM
    • CWP89.HTM
    • CWP9.HTM
    • CWP90.HTM
    • CWP91.HTM
    • CWP92.HTM
    • CWP93.HTM
    • CWP94.HTM
    • CWP95.HTM
    • CWP96.HTM
    • CWP97.HTM
    • CWP98.HTM
    • CWP99.HTM
    • FrameControl1.HTM
    • gradleft.jpg
    • gradtop.jpg
    • graycorner.jpg
    • linestat.html
    • minus.jpg
    • plus.jpg
    • Solution_FrameControl1.HTM
    • titletile.jpg
    • vt.js
    • FrameControl_install.zip
    • FrameControl1.csproj
    • FrameControl1.csproj.user
    • FrameControl1.sln
    • Global.cs
    • JMTools.cs
    • obj
      • Debug
        • temp
        • TempPE
      • Release
        • FrameControl1.dll
        • FrameControl1.projdata
        • temp
        • TempPE
    • RewriteURL.cs
    • SessionTransit.cs
    • SPGenerator.cs
using System;
using System.Web;
using System.Collections;
using System.Configuration;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;

namespace JobMorning
{
	/// <summary>
	/// ApplicationTransit describes methods that are common between all users. This object is stored in
	/// the application Object which methods are defined in Global.asax.
	/// </summary>
	public class ApplicationTransit
	{
		// number of user paths
		private int nbUserPaths;
		// Define an ArrayList for each UserPaths defined
		// At this stage, the number of UserPaths should be defined.
		private ArrayList[] allLists; 
		// = new ArrayList[nbUserPaths];
		private HttpApplicationState appObject;

		public ApplicationTransit(int nbPaths)
		{
			nbUserPaths = nbPaths;
			allLists = new ArrayList[nbPaths];
			appObject = HttpContext.Current.Application;
		    
		}
		
		/// <summary>
		/// The CreateXmlFlow function creates a XML description of all children controls contained 
		/// in a container control. CreateXmlFlow supports the following children controls: 
		/// WebControls.TextBox, HtmlControls.HtmlInputText, WebControls.CheckBox, 
		/// WebControls.RadioButton, WebControls.DropDownList, WebControls.CheckBoxList, 
		/// WebControls.RadioButtonList, WebControls.Panel.
		/// In the case of a WebControls.Panel control, all children Controls inside the Panel
		/// are also described.
		/// </summary>
		/// <param name="container">Can be a child control or a container control. In case it is a container control, 
		/// strXml will encapsulate the result in a <c>container</c> tag</param>
		/// <param name="pageInputs">
		/// An Hashtable containing a list of all input forms values indexed by the name tag (the control name ) 
		/// of the HTML element.
		/// </param>
		/// <returns>
		/// The CreateXmlFlow function creates a XML description of all children controls contained 
		/// in a container control. The description contains the data entered by the user (node InnerText), 
		/// the type of the control (attribute type of the node) and also the ID of the control
		/// (attribute name of the node).
		/// </returns>
		
		public string CreateXmlFlow(Control container, ref Hashtable pageInputs)
		{
			string strReturnXml = "";
			// strDBControl is used to retrieve the DBParam for each control
			// needed to be saved in the database
			string strDBParam;
			foreach (Control c in container.Controls)
			{
				// the type of the container begins by ASP. if it is a control.ascx 
				if ((c is INamingContainer)&(c.GetType().ToString().Substring(0,3).Equals("ASP")))
				{
					strReturnXml += "<container>"; 
					strReturnXml += "<name>"+c.ID+"</name>";
					strReturnXml += CreateXmlFlow(c, ref pageInputs);
					strReturnXml += "</container>";

				}
				if (c.GetType().ToString().Equals("System.Web.UI.WebControls.Panel"))
				{
					strReturnXml += "<panel>"; 
					strReturnXml += "<name>"+c.ID+"</name>";
					strReturnXml += CreateXmlFlow(c, ref pageInputs);
					strReturnXml += "</panel>";
				}
				if (c.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox"))
				{
					strDBParam = ((TextBox) c).Attributes["dbcontrol"];
					strReturnXml += @"<item type=""TextBox"" name="""+c.ID+@"""";
					if (strDBParam!=null)
					{
						strReturnXml += @" dbcontrol="""+strDBParam+@"""";
					}
					strReturnXml += ">";
					strReturnXml += ((TextBox) c).Text;
					strReturnXml += "</item>";
					pageInputs.Add(c.ID,((TextBox) c).Text);
				}



				if (c.GetType().ToString().Equals("System.Web.UI.HtmlControls.HtmlInputText"))
				{
					strDBParam = ((HtmlInputText) c).Attributes["dbcontrol"];
					strReturnXml += @"<item type=""HtmlInputText"" name="""+c.ID+@"""";
					if (strDBParam!=null)
					{
						strReturnXml += @" dbcontrol="""+strDBParam+@"""";
					
					}
					strReturnXml += ">";
					strReturnXml += ((HtmlInputText) c).Value;
					strReturnXml += "</item>";
					pageInputs.Add(c.ID,((HtmlInputText) c).Value);
				}
				if (c.GetType().ToString().Equals("System.Web.UI.WebControls.CheckBox"))
				{
					strDBParam = ((CheckBox) c).Attributes["dbcontrol"];
					strReturnXml += @"<item type=""CheckBox"" name="""+c.ID+@"""";
					if (strDBParam!=null)
					{
						strReturnXml += @" dbcontrol="""+strDBParam+@"""";
					}
					strReturnXml += @" text=""";
					strReturnXml += ((CheckBox) c).Text +@""">";
					strReturnXml += ((CheckBox) c).Checked.ToString();
					strReturnXml += "</item>";
					pageInputs.Add(c.ID,((CheckBox) c).Checked);
				}
				if (c.GetType().ToString().Equals("System.Web.UI.WebControls.RadioButton"))
				{
					strDBParam = ((RadioButton) c).Attributes["dbcontrol"];
					strReturnXml += @"<item type=""RadioButton"" name="""+c.ID+@"""";
					if (strDBParam!=null)
					{
						strReturnXml += @" dbcontrol="""+strDBParam+@"""";
					}
					strReturnXml += @" text=""";
					strReturnXml += ((RadioButton) c).Text +@""">";
					strReturnXml += ((RadioButton) c).Checked.ToString();
					strReturnXml += "</item>";
					pageInputs.Add(c.ID,((RadioButton) c).Checked);
				}
				if (c.GetType().ToString().Equals("System.Web.UI.WebControls.DropDownList"))
				{
					strReturnXml += "<DropDownList><name>"+c.ID+"</name>";
					
					// items will describe all the Selected values of the DropDownList items,
					// this time the key index is the item string content.
					Hashtable itemsHT = new Hashtable();
					foreach (ListItem litem in ((DropDownList) c).Items)
					{
						strDBParam = litem.Attributes["dbcontrol"];
						strReturnXml += @"<item type=""DropDownList.item"" text="""+litem.Text;
						if (strDBParam!=null)
						{
							strReturnXml += @" dbcontrol="""+strDBParam+@"""";
						}
						strReturnXml += @""">";
						strReturnXml += litem.Selected.ToString();
						strReturnXml += "</item>";
						itemsHT.Add(litem.Text,litem.Selected);
					}
					strReturnXml += "</DropDownList>";
					pageInputs.Add(c.ID, itemsHT);
				}
				if (c.GetType().ToString().Equals("System.Web.UI.WebControls.CheckBoxList"))
				{
					Hashtable itemsHT = new Hashtable();
					strReturnXml += "<CheckBoxList><name>"+c.ID+"</name>";
					foreach (ListItem litem in ((CheckBoxList) c).Items)
					{
						strDBParam = litem.Attributes["dbcontrol"];
						strReturnXml += @"<item type=""CheckBoxList.item"" text="""+litem.Text;
						if (strDBParam!=null)
						{
							strReturnXml += @" dbcontrol="""+strDBParam+@"""";
						}
						strReturnXml += @""">";
						strReturnXml += litem.Selected.ToString();
						strReturnXml += "</item>";
						itemsHT.Add(litem.Text,litem.Selected);
					}
					strReturnXml += "</CheckBoxList>";
					pageInputs.Add(c.ID, itemsHT);
				}
				if (c.GetType().ToString().Equals("System.Web.UI.WebControls.RadioButtonList"))
				{
					Hashtable itemsHT = new Hashtable();
					strReturnXml += "<RadioButtonList><name>"+c.ID+"</name>";
					foreach (ListItem litem in ((RadioButtonList) c).Items)
					{
						strDBParam = litem.Attributes["dbcontrol"];
						strReturnXml += @"<item type=""RadioButtonList.item"" text="""+litem.Text;
						if (strDBParam!=null)
						{
							strReturnXml += @" dbcontrol="""+strDBParam+@"""";
						}
						strReturnXml += @""">";
						strReturnXml += litem.Selected.ToString();
						strReturnXml += "</item>";
						itemsHT.Add(litem.Text,litem.Selected);
					}
					strReturnXml += "</RadioButtonList>";
					pageInputs.Add(c.ID, itemsHT);
				}

			}
			return strReturnXml;
		}
		

		
	}
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Japan Japan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions