Click here to Skip to main content
15,894,539 members
Articles / Web Development / HTML

Writing Object-Oriented JavaScript Part 3

Rate me:
Please Sign up or sign in to vote.
4.64/5 (19 votes)
9 Dec 200311 min read 99.6K   1.1K   63  
Using Cfx to develop a JavaScript control class library.
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="CfxWebFormNotes.ascx.cs" Inherits="ControlDemo.controls.CfxWebFormNotes" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<table style="BORDER-RIGHT: #336699 1px solid; BORDER-TOP: #336699 1px solid; BORDER-LEFT: #336699 1px solid; BORDER-BOTTOM: #336699 1px solid" cellSpacing="5" cellPadding="0" width="240" border="0">
	<tr>
		<td class="SmNorm"><span class="LgNormBlue"><b>JavaScript Class Framework</b></br><b>Control class demo</b></br></span>
			This demo shows how to use Cfx to build JavaScript controls as a resuable and object-orinented
			class heirarchy.
		</td>
	<tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="SmNorm"><b><span class="LgNorm">JavaScript Controls</span> &gt;&gt;&gt;</b><br />
			The controls on the form are contained by the CfxWebFormOptions control.  It consists 
			of 5 CfxText controls and a CfxSelect control to obtain the user name and address.  It
			has a button element for submitting the form and a CfxHistoryOptions control containing
			a CfxRadioSet control with affiliated CfxSelect controls.		
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="SmNorm"><b><span class="LgNorm">A Client Approach</span> &gt;&gt;&gt;</b><br>
			Cfx sets up the client events -- a departure from the typical ASP.NET approach
			of adding event attributes to controls.  Using Cfx can reduce server-side ASP.NET code
			shifting client side issues to JavaScript.  
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="SmNorm"><b><span class="LgNorm">Specifying Input</span> &gt;&gt;&gt;</b><br>
			The demo validates that the user name is entered and a valid history option
			is selected.  You can submit the form hitting the enter key or using the submit
			button. The form will notify you of any validation errors.		
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="SmNorm"><b><span class="LgNorm">Benchmarks</span> &gt;&gt;&gt;</b><br>
			The demo displays the load and validation time in milliseconds.  This will give
			you an feel of Cfx efficiency.  Its efficiency should encourage its use and
			writing JavaScript using OOP techniques.		
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="SmNorm"><b><span class="LgNorm">Enjoy Using Cfx!</span></b><br>
		</td>
	</tr>
</table>

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
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions