We would like to share with the world the free ASP.NET code generator that creates
stunning ASP.NET+AJAX web applications straight from the database.
The generated applications feature modern Web 2.0 user interface, advanced multi-level
menu, security system built on top of Microsoft ASP.NET Membership, complex master-detail
page layouts, efficient filtering, paging and sorting of very large datasets, data export
in CSV, Excel, and RSS format, instant PDF, Excel, and TIFF reports. The application code
base is relying on Microsoft ASP.NET Ajax Extensions and Ajax Control Toolkit. The
reports are produced with the free Microsoft Report Viewer.
Generated applications work identically in major browsers including Internet Explorer
7-8, Firefox, Safari, Chrome, and Opera.
The entire source code of the generated applications is included without any external
dependencies. You will also find all code generator templates in the source code form as
well. Application code is generated in Visual Baisc.NET or C#.
Please follow these instructions to install the ASP.NET code generator and code
generation projects:
- Download the free code generator at http://codeontime.com or directly from http://store.codeontime.com/install/setup.exe.
- Run the installation program and install the code generator.
- Start the code generator and click on Install button to install the code generation
library. The code generation library includes a collection of XSLT stylesheets,
JavaScript files, CSS, and graphics resources. Wait for installation to complete.
- In the menu of available code generation projects select the free code generator
project Web Site Builder. Follow the instructions to configure the
database connection and complete all steps of the project wizard. The end result will
look similar to the applications below.
You will find live demos of the generated applications at http://blog.codeontime.com/2009/11/web-site-factory-preview-3.html.
This tool will benefit anyone interested in learning, prototyping, and implementing
AJAX applications for ASP.NET. If you are a database administrator, then you can have an
attractive and easy to use application on top of your database in minutes. The generated
applications can serve as a great foundation for any new projects.
The following markup represents the code in picture.
<%@ Page Language="C#"
MasterPageFile="~/Main.master" AutoEventWireup="true"
CodeFile="Employees.aspx.cs"
Inherits="Pages_Employees" Title="Employees" %>
<asp:Content ID="Content1"
ContentPlaceHolderID="PageHeaderContentPlaceHolder"
runat="Server">
Employees</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="PageContentPlaceHolder" runat="Server">
<div factory:flow="NewRow" xmlns:factory="urn:codeontime:app-
factory">
<div factory:activator="Tab|Employees">
<div id="view1" runat="server">
</div>
<aquarium:DataViewExtender id="view1Extender" runat="server"
TargetControlID="view1"
Controller="Employees" view="grid1" ShowInSummary="True"
/>
</div>
<div factory:activator="Tab|Employees">
<div id="view2" runat="server">
</div>
<aquarium:DataViewExtender id="view2Extender" runat="server"
TargetControlID="view2"
Controller="Employees" view="grid1"
FilterSource="view1Extender"
FilterFields="ReportsTo" />
</div>
<div factory:activator="Tab|Orders">
<div id="view3" runat="server">
</div>
<aquarium:DataViewExtender id="view3Extender" runat="server"
TargetControlID="view3"
Controller="Orders" view="grid1"
FilterSource="view1Extender" FilterFields="EmployeeID" />
</div>
<div factory:activator="Tab|Employee Territories">
<div id="view4" runat="server">
</div>
<aquarium:DataViewExtender id="view4Extender" runat="server"
TargetControlID="view4"
Controller="EmployeeTerritories" view="grid1"
FilterSource="view1Extender"
FilterFields="EmployeeID" />
</div>
</div>
</asp:Content>
<asp:Content ID="Content3"
ContentPlaceHolderID="SideBarPlaceHolder" runat="Server">
<div class="TaskBox">
<div class="Inner">
<div class="Header">
About</div>
<div class="Value">
This page allows employees management.</div>
</div>
</div>
</asp:Content>
The single set of code generation templates produces the equivalent application in C#
and VB.NET.
This is a sample of the code generation template that creates one of the files of
application framework in the foundation of the generated applications.
="1.0" ="utf-8"
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.codeontime.com/2008/codedom-compiler"
xmlns:a="urn:schemas-codeontime-com:data-aquarium-project"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-
prefixes="msxsl a"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<compileUnit namespace="{a:project/a:namespace}.Data">
<imports>
<namespaceImport name="System"/>
<namespaceImport name="System.Collections.Generic"/>
<namespaceImport name="System.ComponentModel"/>
<namespaceImport name="System.Data"/>
<namespaceImport name="System.Data.Common"/>
<namespaceImport name="System.Linq"/>
<namespaceImport name="System.Text"/>
<namespaceImport name="System.Text.RegularExpressions"/>
<namespaceImport name="System.Xml"/>
<namespaceImport name="System.Xml.XPath"/>
<namespaceImport name="System.Web"/>
<namespaceImport name="System.Web.Caching"/>
<namespaceImport name="System.Web.Configuration"/>
<namespaceImport name="System.Web.Security"/>
</imports>
<types>
-->
<typeDeclaration name="View">
<members>
-->
<memberField type="System.String" name="id"/>
<memberProperty type="System.String" name="Id">
<attributes public="true" final="true"/>
<getStatements>
<methodReturnStatement>
<fieldReferenceExpression name="id"/>
</methodReturnStatement>
</getStatements>
</memberProperty>
-->
<memberField type="System.String" name="label"/>
<memberProperty type="System.String" name="Label">
<attributes public="true" final="true"/>
<getStatements>
<methodReturnStatement>
<fieldReferenceExpression name="label"/>
</methodReturnStatement>
</getStatements>
</memberProperty>
-->
<memberField type="System.String" name="headerText"/>
<memberProperty type="System.String" name="HeaderText">
<attributes public="true" final="true"/>
<getStatements>
<methodReturnStatement>
<fieldReferenceExpression name="headerText"/>
</methodReturnStatement>
</getStatements>
</memberProperty>
-->
<memberField type="System.String" name="type"/>
<memberProperty type="System.String" name="Type">
<attributes public="true" final="true"/>
<getStatements>
<methodReturnStatement>
<fieldReferenceExpression name="type"/>
</methodReturnStatement>
</getStatements>
</memberProperty>
-->
<constructor>
<attributes public="true"/>
</constructor>
-->
<constructor>
<attributes public="true"/>
<parameters>
<parameter type="XPathNavigator" name="view"/>
<parameter type="IXmlNamespaceResolver" name="resolver"/>
</parameters>
<statements>
<assignStatement>
<fieldReferenceExpression name="id">
<thisReferenceExpression/>
</fieldReferenceExpression>
<castExpression targetType="System.String">
<methodInvokeExpression methodName="Evaluate">
<target>
<argumentReferenceExpression name="view"/>
</target>
<parameters>
<primitiveExpression value="string(@id)"/>
</parameters>
</methodInvokeExpression>
</castExpression>
</assignStatement>
<assignStatement>
<fieldReferenceExpression name="type">
<thisReferenceExpression/>
</fieldReferenceExpression>
<castExpression targetType="System.String">
<methodInvokeExpression methodName="Evaluate">
<target>
<argumentReferenceExpression name="view"/>
</target>
<parameters>
<primitiveExpression value="string(@type)"/>
</parameters>
</methodInvokeExpression>
</castExpression>
</assignStatement>
<assignStatement>
<fieldReferenceExpression name="label">
<thisReferenceExpression/>
</fieldReferenceExpression>
<castExpression targetType="System.String">
<methodInvokeExpression methodName="Evaluate">
<target>
<argumentReferenceExpression name="view"/>
</target>
<parameters>
<primitiveExpression value="string(@label)"/>
</parameters>
</methodInvokeExpression>
</castExpression>
</assignStatement>
<assignStatement>
<fieldReferenceExpression name="headerText">
<thisReferenceExpression/>
</fieldReferenceExpression>
<castExpression targetType="System.String">
<methodInvokeExpression methodName="Evaluate">
<target>
<argumentReferenceExpression name="view"/>
</target>
<parameters>
<primitiveExpression value="string(c:headerText)"/>
<argumentReferenceExpression name="resolver"/>
</parameters>
</methodInvokeExpression>
</castExpression>
</assignStatement>
</statements>
</constructor>
</members>
</typeDeclaration>
</types>
</compileUnit>
</xsl:template>
</xsl:stylesheet>
Code generators have long endured bad reputation for the quality of generated
applications – not anymore. Use the free Code OnTime Generator and
Web Site Builder and prove those still in doubt to be wrong.
Please enjoy.