News

Internet - .Net user group technical events, emerging .Net technologies;
General - Eco-travel, health and fitness, current events;
Community - Active volunteer with Hands On Miami, Non-Profit Ways;
.Net Framework - Detected 3.5 SP1 .NET Framework. No update needed ;

Twitter









Expression Web Interface

The success of any design tool lies on how well its interface contributes to your productivity. Expression Web’s interface is designed specifically to make access to tools easy while maintaining maximum area for design surface. Specialized task panes, toolbars and visual designs give you precise control of page layout and formatting.
Workspace
The Microsoft® Expression® Web workspace provides you with the tools you need to create and modify web pages and websites. The workspace is customizable, so you can change the way it looks to best match your working style. Here's what the workspace looks like when you first install Expression Web.
Expression Web Workspace

TIP: To reset the workspace to the default, on the Task Panes menu, click Reset Workspace Layout. 

 

Toolbars can contain buttons, menus or a combination of both.
Task Panes

 

The folder list has many similar features like a file manager, such as creating new folders, adding files, deleting folders, and so on. The Folder List is similar to the Web Site tab in the Editing window. But this tab allows for more customized views than the basic view provided by the Folder List.

 

 
Expression Web Toolbox 
d.     Apply Styles and Manage Styles:
The Apply Styles task pane enables you to apply, remove, modify and delete styles; attach or detach external cascading style sheets (CSS); select all instances of a style and traverse to the code that defines a style’s rule set. Apply Styles task pane displays each style according to the rules of the style, so you can identify the style you want to apply just by looking at the style’s visual appearance.
 Expression Web Manage Styles
 
When you open a Webpage, this task pane lists styles that are defined in all of the pages and CSS, including external, inline and internal CSS. You can set the task pane to list all styles or only the styles used in current web page or current selection in the page.
The Manage Styles task pane enables you to do all the tasks you can do with Apply Styles task pane. Apart from these tasks you can use Manage Styles task pane to move styles from an external CSS to an internal CSS and vice versa, or to move the location of a style within a CSS.
When you open a web page, the Manage Styles task pane lists all styles that are defined in the page, external and internal CSS, but not inline CSS. All class-based, element-based and id-based styles appear under either the name of the external.css file that contains the style or Current Page if the style is in an internal CSS.        
All the other Task Panes can be found in the Task Panes Menu. Task Panes can be maximized by clicking on the maximize button. You can have multiple task panes open at a time and adjust the position and size of each task pane according to your requirement. For that you can drag a task pane to any edge of the Expression Web Interface to dock it on that edge or drag it away from an edge to make it a floating task pane that can be positioned anywhere within the user interface. When you arrange the task panes in a layout that suits your need, Expression Web automatically uses this layout the next time you start the program.
Task panes also contain tabs so that multiple task panes can be present within the same window. The following figure shows the Manage Styles task pane with several tabs inside it. TO activate any of the other task panes, simply click the tab. Arrows are also provided when the pane doesn’t have enough space to display all tabs.
To add a task pane as a tab within another task pane, simply drag one task pane on top of another.
To open other task panes
Select the intended task pane from the Task Panes menu. A checkmark on the Task Panes menu indicates that a task pane is visible in your workspace. If a task space is selected but is not visible because it is merged with other task panes, simply click the task pane on the Task Panes menu to make the task pane visible.
Expression Web Task Pane Menu
To move a task pane
Click on the title bar of the Task Pane and then drag the title bar of the task pane to the new location.
To dock a task pane
You can both drag the title bar of a floating task pane to the edge of the program window or Right-click the task pane tab or title bar and then click Dock.
To float a task pane
You can both drag the title bar of a docked task pane away from the edge of the program window or Right-click the task pane tab or title bar and then click Float.
Editing Window
Editing Window is the area in Microsoft Expression Web where you create and modify your Web pages.
ExpressionWeb Editing Window

 

 
The top of the Editing Window shows the files that are open in the form of tabs. The file you are currently working on is highlighted. You can close the current page or file by clicking on the cross displayed on the extreme right corner of the Editing Window. You can switch between the tabs by keyboard shortcuts Ctrl + Tab or Ctrl + Shift + Tab.
Below the tabs is a Quick Tag Selector Bar. HTML tags from the document are displayed on this bar in a nested order. To select the tag you can either click on it or on the arrow next to it for more options.
In addition to these, there are three views to this window for the purpose of editing the web pages.
Page views –
Design View: This view is WYSIWYG. You can create and edit web pages using the design controls in this view.
Split View: You can review and edit web page content in a split screen format that offers you a simultaneous access to both the Code and Design views.
Code View: You can view, write and edit the HTML tags yourself with the optimize code features provided.
For switching between these three views you can use the keyboard shortcuts Ctrl + Page up or Ctrl + Page Down
The Editing Window in Expression Web does not use Internet Explorer for rendering. It is a browser-independent rendering of your web page.
Status Bar
The Status bar of Expression Web is extremely informative. It contains tools that warn you when incompatible or invalid code is detected and also provides information about your current editing modes, such as visual aids mode, style application mode, rendering mode and page size as well as information about the file you are editing, such as file size, HTML schema and CSS schema. 
You can Right-click a file or folder in the Folder List for a menu of options.
 
CAUTION: Any files deleted from the Folder List are permanently deleted. There is no Recycle Bin in Expression Web, so be careful!
 
b.    Tag Properties and CSS Properties:
The Tag Properties task pane enables you to quickly see all of the set attributes and values of the tags that are currently active in the current web page. The task pane also enables you to modify the set attributes and set new attributes for the current tag.
Expression Web Tag Properties and CSS Properties
CSS Properties task pane can be used with an open web page, external CSS file, or with the Manage Styles task pane to review and change the properties and values of existing styles. The CSS Properties task pane enables you to quickly see all of the styles that the current selection in your web page uses, the order of precedence of those styles, and all of the properties and values of those styles. 
c.    Toolbox:   
Toolbox task pane contains HTML Elements, Form Controls and ASP.NET Controls. Microsoft Expression Web has made it convenient for you to use all these controls in your web pages only by dragging these onto your web pages. The code Expression Web creates when you drag an item onto your page depends upon the DocType declaration in your page.   
Task Panes in Microsoft Expression Web are designed to help you access the tools you need, easily while you work. The default interface will include an Editing window surrounded by four task panes:
a. Folder List:
Expression Web displays all the files and folders in the current Website inside the Folder List task pane. You can expand the folders by clicking the [+] button to the left of the folder name and collapse folders by clicking the [-] button to the left of the folder name.
Expression Web Folder List  
Workspace comprises of:
i.      Menu and Toolbars
ii.     Task Panes
iii.    Editing Window
iv.   Status Bar
Menus and Toolbars
Menus display a list of commands. Most of these commands have images next to them to help you quickly associate the command with the image. For instance File Menu contains commands like New, Open, Open Site, and so on. Some of these commands are also expandable displaying some more options. Expression Web Menus and Toolbar

 

1.       Code Error Detected Expression Web Code Error icon : You can traverse to the error in the code on your web page.
2.       HTML Incompatibility Detected Expression Web Incompatibility detected icon: You can go to the HTML incompatibility schema in your code.  

 

 
6.       Standard Standard Rendering mode. The rendering mode is determined by the document’s DocType. Double clicking would open the Page Editor Dialog box from where you can select the suitable DocType. For more information see How to Set Document Type Information later in this article.  

 

 
8.       XHTML 1.0 TThis tells you what document type is set. Double clicking would open the Page Editor Options dialog box that would show the options for HTML Schema. For more information see How to Set Document Type Information later in this article.  
9.       CSS 2.1: This shows the CSS Schema that Expression Web applies to the current page. Double click to open the Page Editor Option dialog box. For more information see How to Set Document Type Information later in this article.   
Visual Aids are user interface elements that make it easier to work with Web pages. Expression® Web offers nine different Visual Aids to make it easier to position items and locate elements on the Web page. Visual aids help you see empty or invisible elements and elements with hidden borders. You can also use visual aids to find elements that have hidden or invisible styles, as well as ASP.NET controls that aren't visible on a page. Finally you can use visual aids to see which tags are used around specific content, and you can see the size of margins and padding around your tags.
To access Visual Aids; select Visual Aids from View menu and select the desired visual aid from the sub menu.
NOTE: The Status bar displays the current status of the Visual Aid. You can turn it on or off just by double clicking on the Visual Aids area of the Status bar. 
Following Visual Aids are available on the Visual Aids menu: 
 1.       Block Selection= This is enabled by default. Expression® Web displays a block selector for HTML blocks. A Block selector is a small tag indicator, when you hover your cursor in a block a dotted rectangle appears around the tag. When you select the block a shaded area is displayed indicating padding around the element.
2.       Visible Borders= This selection displays dotted borders around HTML elements that don’t have borders. For instance, a table in Expression® Web, Visual borders will render a dotted border around every cell even if the table has no border.
3.       Empty Containers= The Empty Containers Visual Aid displays borders around certain elements that act as containers for other elements. For example, an HTML form is visible by default in Design View, even when the form has no controls in it.
4.       Margins and Padding= This shows the margins and padding around all elements; margins appear in red and padding appears in blue. You cannot use Margins and padding visual aid to change margins and padding.
5.       CSS Display: none elements=Shows elements that are hidden by a style that includes display: none.
6.       CSS Visibility: hidden Elements = Shows elements that are hidden by a style that includes visibility: hidden.
7.       ASP.NET Non-visual Controls= Shows a rectangle for ASP.NET controls which don't display anything.
8.       ASP.NET Control Errors= Shows an error message when an ASP.NET control encounters an error, such as not connecting to a data source.
9.       Template Region Labels= Shows a border around editable template regions, including a tab with the name of the region, in pages based on Dynamic Web Templates or ASP.NET master pages.
The Browsers read the Document Type (DocType) information to determine which version of HTML is used in the web page. You can set a default DocType so that Microsoft® Expression® Web automatically inserts a DocType declaration on all the new pages. You can also choose not to automatically insert a DocType declaration on new pages.
     Expression Web Page Editor Options
The DocType declaration on a web page also determines the schema Expression Web uses to coerce incompatibility notifications and IntelliSense for HTML and script. Expression Web uses the secondary schema if a page has an unrecognized or missing DocType. If there is an incompatibility or error in your HTML, Expression Web displays it as an icon in the status bar. The Code Error Detected icon indicates an error in the code on your page. The HTML Incompatibility Detected icon indicates an incompatibility with the HTML schema you selected.
To set the default DocType declaration that Expression Web inserts when you create new pages  
On the Tools menu, click Page Editor Options.
In the Page Editor Options dialog box, on the Authoring tab, select the DocType and Secondary Schema you want to use for all new files.
NOTE: To prevent Expression Web from inserting a DocType declaration, in the DocType box, select None.  
To change the DocType declaration in an existing page  
In Code view, in your page, edit the DocType declaration. Here's an example of a DocType declaration.
<! DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
When you format items in a web page, Microsoft® Expression® Web produces that formatting by generating new styles in an internal cascading style sheet (CSS) or modifying existing styles in the CSS.
Expression Web generates and modifies styles for you in Auto mode (default) or Manual mode. No matter which mode you choose, when you format an item that doesn't have a style, Expression Web generates and applies a new style for you. For example, if you select a paragraph of plain text in your web page and apply color to the text by using the Font Color button in the Common toolbar, Expression Web creates a new style and applies it to the text to format its color. If you then format another property of that same paragraph of text, such as the paragraph's font-family, Expression Web adds a new property declaration to the generated style it just created.
In Manual mode, you can write your own CSS to simplify your design process. You also have additional control provided by the Style Application toolbar.
TIP: If you're new to writing CSS, use Auto mode. If you're an experienced CSS author that can write your own CSS, use Manual mode to streamline your design process.  

 

7.       591 x 554Describes the current page size of the editing window. To change the size of the window click on the current size and select the size from the list or select Modify Page sizes. 
 

 

 
TIP: You can add, modify or remove the page size setting also in the Design view from View menu, select Page Size and then click Modify Pages.
 
3.       Visual Aids: Off: Change the Visual aids mode. For more information see Visual Aids later in this article.  

 

 
4.       Style Application :Manual: Double click to open the Style Applicator Toolbar and change the mode. For more information see Generated Cascading Stylesheets later in this article.  

 

 
5.       87.6 KB: Size of the current file. When you hover over the number, Download statistics are displayed, which give a breakup of the total file size. 

ADO.NET Data Architecture

DataSet

The dataset is a disconnected, in-memory representation of data. It can be considered as a local copy of the relevant portions of the database. The DataSet is persisted in memory and the data in it can be manipulated and updated independent of the database. When the use of this DataSet is finished, changes can be made back to the central database for updating. The data in DataSet can be loaded from any valid data source like Microsoft SQL server database, an Oracle database or from a Microsoft Access database.

Data Provider

The Data Provider is responsible for providing and maintaining the connection to the database. A DataProvider is a set of related components that work together to provide data in an efficient and performance driven manner. The .NET Framework currently comes with two DataProviders: the SQL Data Provider which is designed only to work with Microsoft's SQL Server 7.0 or later and the OleDb DataProvider which allows us to connect to other types of databases like Access and Oracle. Each DataProvider consists of the following component classes:

The Connection object which provides a connection to the database
The Command object which is used to execute a command
The DataReader object which provides a forward-only, read only, connected recordset
The DataAdapter object which populates a disconnected DataSet with data and performs update


Data access with ADO.NET can be summarized as follows:

A connection object establishes the connection for the application with the database. The command object provides direct execution of the command to the database. If the command returns more than a single value, the command object returns a DataReader to provide the data. Alternatively, the DataAdapter can be used to fill the Dataset object. The database can be updated using the command object or the DataAdapter.

ADO .NET Data Architecture

Component classes that make up the Data Providers

The Connection Object

The Connection object creates the connection to the database. Microsoft Visual Studio .NET provides two types of Connection classes: the SqlConnection object, which is designed specifically to connect to Microsoft SQL Server 7.0 or later, and the OleDbConnection object, which can provide connections to a wide range of database types like Microsoft Access and Oracle. The Connection object contains all of the information required to open a connection to the database.

The Command Object

The Command object is represented by two corresponding classes: SqlCommand and OleDbCommand. Command objects are used to execute commands to a database across a data connection. The Command objects can be used to execute stored procedures on the database, SQL commands, or return complete tables directly. Command objects provide three methods that are used to execute commands on the database:

ExecuteNonQuery: Executes commands that have no return values such as INSERT, UPDATE or DELETE
ExecuteScalar: Returns a single value from a database query
ExecuteReader: Returns a result set by way of a DataReader object


The DataReader Object

The DataReader object provides a forward-only, read-only, connected stream recordset from a database. Unlike other components of the Data Provider, DataReader objects cannot be directly instantiated. Rather, the DataReader is returned as the result of the Command object's ExecuteReader method. The SqlCommand.ExecuteReader method returns a SqlDataReader object, and the OleDbCommand.ExecuteReader method returns an OleDbDataReader object. The DataReader can provide rows of data directly to application logic when you do not need to keep the data cached in memory. Because only one row is in memory at a time, the DataReader provides the lowest overhead in terms of system performance but requires the exclusive use of an open Connection object for the lifetime of the DataReader.

The DataAdapter Object

The DataAdapter is the class at the core of ADO .NET's disconnected data access. It is essentially the middleman facilitating all communication between the database and a DataSet. The DataAdapter is used either to fill a DataTable or DataSet with data from the database with it's Fill method. After the memory-resident data has been manipulated, the DataAdapter can commit the changes to the database by calling the Update method. The DataAdapter provides four properties that represent database commands:

SelectCommand
InsertCommand
DeleteCommand
UpdateCommand

When the Update method is called, changes in the DataSet are copied back to the database and the appropriate InsertCommand, DeleteCommand, or UpdateCommand is executed. 

I have been focus on dot.net development

I have been focus on dot.net development.    This is one of my sample website: http://dischigh.com  that I created for sample store via php. ;

 

 

 Please visit my other site: http://dotnetmai.comhttp://politics.dotnetmai.com; http://family.dotnetmai.com

My new blogs dotnetmai

 Between my geekswithblog and CS, I will be able to blogs, and discuss some more :)  about SQL Server and dot net

Thank you for continue supported and please visit my new geek site    

Click Here

Best Regards,
Geeketemai

                   

http://dotnetmai.com/ShowCategories.aspx

http://dotnetmai.com/ShowCategories.aspx

Florida.NET User Group a Success with code idol Contest!

I attended the Florida.net at Citrix Ft Lauderdale on 10/02/2007 and have seen all the talented “GEEKS” successfully presented their codes:

Steve Potter - Cache Register
Jonas Strawski - SQL Server as Document Repository
Lou Yovin - Volume Shadow Copy
Tim Corbett - System Tray App
Louis Datz - dashCommerce
Martin Anderson - XML Schemas and powershell
Max Trinidad - Powershell script to create CSV

Shervin Shakibi, Dave Noderer, and Jeff Barnes of Microsoft who were Judges and Mc as well.

As all of the presenters, some of them did very well. (50's in this case, on a 10-50 rating). 

I was honoring seeing Dave Noderer, finaly met Sherwin Shakibi and everyone at Florida.Net and the most happiest of that night  I ran into my former boss Jeff Barnes.  Though he is now a big and famous as Microsoft Architect Evangelist, but he is still the nicest, kindness, and down to earth Jeff Barness that I remembered back in IT Burger King Corporation.

Thank you Dave Noderer for the Citrix location resources/eateries/knowledge you provided. 

I have very good times(For a long time since I have been at the last event) at the code Idol Contest Event I've learned some techiques only came from these genius geeks I have met that night.

 

 

Database Object Security

No discussion of the new CLR features would be complete without a description of the security issues associated with using .NET assemblies and the SQL Server CLR:

http://m.makesdatawork.net/ShowArticle.aspx?ID=145

Display Record's Description Through AJAX

 

Description:

This customization utilizes the power of AJAX to make asynchronous calls to server-side methods. The server-side methods then call back a JavaScript function to display data in a popup window. The code customization for .NET Framework 2.0 uses the Microsoft Atlas library. For .NET Framework 1.1, the AJAXPro (available free) third-party DLL is used.

Procedure:

Step 1: Call JavaScript function on MouseOver

Define an area that the user can mouse over to see the popup data.  When the user mouses over, the MyCustomFunction JavaScript function is called.  This function takes two arguments.  The first argument is the Id of the record being retrieved.  The second argument is the reserved word 'event' that specifies the location of the mouse.

You can use a code generation tag to specify a field value within the table row.  Make sure to specify the database field corresponding to the Field Value code generation tags on the Page Properties dialog box. 

 <a OnMouseOver='MyCustomFunction(<GEN:FieldValue NAME="MyRecordID"/>, event);'>
    <GEN:FieldValue NAME="MyRecordName"/>
</a>

Step 2: Define two JavaScript functions

Define two JavaScript functions within the script tags in the HTML page. The first function is called by the MouseOver event.  It will save the current mouse position and then call the server-side method declared in your page class.  The second function is the call-back function called by the server-side method.

There are slight differences between .NET Framework 1.1 (using AjaxPro.dll) and .NET Framework 2.0 (using Microsoft Atlas) as shown below.

For .NET Framework 1.1

<script type ="text/javascript">
function MyCustomFunction(MyRecordID, event)
{
    // Save the mouse position for later use by detailRolloverPopup
    SaveMousePosition(event);

    // Invoke the AJAX method defined in the code-behind of the page
    // Replace MYAPP with your application's name and MYPAGE with the corresponding Page class's name.
    // Also, specify the callback function - MyCallBack (defined below)
    MYAPP.UI.MYPAGE.GetRecordDescription(MyRecordID, MyCallBack);
}

function MyCallBack(result)
{
    // The detailRollOverPopup() displays the content returned from the AJAX call in a popup window
    // It accepts three parameters:
    // - aTitle, string to be displayed in the title bar of the popup window.
    // - aContent, string containing HTML to be displayed in the body of the popup.
    // - aPersist, boolean indicating whether the popup should remain visible even on mouseout.
    detailRolloverPopup('Window Title', result.value, false);
}
</script>

For .NET Framework 2.0

<script type ="text/javascript">
function MyCustomFunction(MyRecordID, event)
{
    // Save the mouse position for later use by detailRolloverPopup
    SaveMousePosition(event);

    // Invoke the WebMethod defined in the code-behind of the page through the PageMethods command
    // Also, specify the callback function - MyCallBack (defined below)
    PageMethods.GetRecordDescription(MyRecordID, MyCallBack);
}

function MyCallBack(result)
{
    // The detailRollOverPopup() displays the content returned from the AJAX call in a popup window
    // It accepts three parameters:
    // - aTitle, string to be displayed in the title bar of the popup window.
    // - aContent, string containing HTML to be displayed in the body of the popup.
    // - aPersist, boolean indicating whether the popup should remain visible even on mouseout.
    detailRolloverPopup('Window Title', result, false);
}
</script>

Step 3: Add ScriptManager reference to page (only for .NET Framework 2.0)

In the HTML page, include the <atlas:ScriptManager> element.  The tag must be within the <form> tag to enable the page for Microsoft Atlas.  This tag enables Atlas client scripts to be downloaded when the web page is requested.

<atlas:ScriptManager ID="scriptManager1" runat="server"/>

Step 4: Use this wizard to add customized code.

Step 5: Build and run the application

Applies To:

    This customization applies to pages with table controls.

Note:

    Please note that this code customization example for .NET Framework 2.0 makes use of the April Community Technology Preview (CTP) version of Microsoft Atlas DLL. 

Disclaimer:

Customizations included in this wizard are provided as a sample to demonstrate a feature, and may work only in specific situations. Geeketee Mai cannot assist in the resolution of problems which may occur as a result of customizing your application or modifying a customization to fit a particular purpose.

 

SQL Statement Generation

 

Specifies where and how to generate your application’s SQL.

Option Inline:

Build the application using inline SQL statements.  The SQL is placed in the Data Access Layer’s generated code.  Inline SQL generation, also called “dynamic SQL” is frequently used when your application must connect to a database that does not support stored procedures.

Option Stored procedures:

(Enterprise Edition feature.)  Build the application’s SQL in database-stored procedures.  The stored procedures are automatically loaded into your database.  Stored procedures are frequently the best choice when overall performance is important, because stored procedures generally execute faster than inline SQL.

Can’t generate stored procedures in all cases

Sometimes we may not be able to generate stored procedures in all cases, even though you have selected this option.  In these cases,  we will generate inline SQL.  For example, we cannot generate stored procedures for Microsoft Access databases, a database product which does not support stored procedures.  Also, we designer will not generate stored procedures in cases where it detects your database access credentials do not have sufficient permissions to load stored procedures into the database or execute them once there.

Other reasons why we can’t generate stored procedures include:

·         You are running SQL Professional Edition.  Only  Enterprise Edition can generate stored procedures.  If you have been switching your development activities between the Professional Edition and Enterprise Editions, you may incorrectly believe that Professional Edition can generate stored procedures.

·         Your database is “read only”.  Check your database permissions to see if any setting has changed to make it read-only, which means stored procedures will not be generated.

·         Your database tables or views are missing primary keys or Virtual Primary Keys.  Check if the changes made to your database views render them capable of having stored procedures generated.  For example, a view without a Virtual Primary Key cannot have an Update stored procedure generated.  (Virtual Primary Keys are an Enterprise Edition feature.)

·         The Stored Procedures option is set to 'true' in the .config file.


 

 

Customizing the Look and Feel

A style sheet (.CSS cascading style sheet) defining the basic stylistic aspects of a design them, such as the fonts, colors, and table styles.  There are two ways to change a design theme’s look and feel:

  • Modify the class definitions within the style sheet.  This is the easiest way to modify a design theme and works best when you want to make global cosmetic changes.

  • Modify the design theme’s look and feel by changing the HTML within the various panel files themselves.  This works best for very specific changes to an individual panel file.

Application Customization and Integration

 


Extensible C# and Visual Basic .NET classes

Code generated by Iron Speed Designer is designed to be customized and then regenerated repeatedly without reapplying your code customizations. This is accomplished by a class hierarchy designed for code customization that is not affected when rebuilding your application.

 

Easy to Customize Code
Simply subclass the appropriate page, control or database class. Your code extensions are preserved when code files are regenerated, allowing you a high degree of flexibility in extending your application program code.

Visible, customizable code. Page and control classes in the Presentation Layer are easy to understand and modify. Quickly see how your application builds SQL queries, loads data, and initializes UI controls – right in the code. To customize, simply override the appropriate method right in the same code file!



Customize data retrieval. Calling custom stored procedures and loading your own data is a snap.



Customize data validation and storage. Quickly add custom data validation and data storage code.



Customize dropdown lists. Customizing the query and sort order for dropdown lists is straightforward, even for the most complex applications.



Customize filters. Customize the query and sort order for filters with ease.



Native ASPX controls. Generated applications use native ASP.NET controls. There's nothing new or proprietary to learn.



Separate UI, Business and Data name spaces. Page classes are generated in the UI name space, the Business name space contains all Record and Table classes, and the Data name space contains classes that connect to your database.

Straightforward Class Hierarchy
Generates a complete, robust class hierarchy for your application. Your application is fully documented and browsable using Code Telescope. Learn more...

Several of the major class types are:

 

Page. A code-behind class is generated for each page in your application. The Web page and user control classes provide advanced functionality, including browser independence, event handling methods for both client and application layer commands, unified object model methods, state management and scalability.
Record. A class corresponding to a record is generated for each database table used in your application to perform record-based access (e.g., insert, update, delete). “Virtual record” classes are generated for each database table and database view that are joined together.
Table. A class is generated for each table and database view in your application to provide the methods necessary to retrieve a group of records based on your filtering criteria and end-user filtering criteria.

Application Security

Built-in security features critical for today's enterprise applications
Although most corporations take security precautions at the network level, the majority of application security must be built into the application itself. Several important application security features including role-based access control, automatic sign-out, and database-resident password storage.

 

Role-based access control
You can automatically add end-user authentication (sign-in) and role-based access control as a standard feature to your applications. This authentication feature is based on your own user and role data in your database, making it easy to set up and administer.

An unlimited number of user roles, and individual users can possess multiple roles. For example, the customer service supervisor has one role as a "rep" with access to customer account information, and a second role as "manager" with authorization to issue refunds or credits. These roles are accessible simultaneously without requiring the user to log in under a second role.

Automatic sign-out
Users are automatically logged-out after a designated period of time to guard against identity theft when a user leaves their Web browser open to the application.This is especially important for applications that connect between enterprises.

Password Storage
Highly sensitive user name and password data is stored directly in the application's existing database tables and not in any separate file that could be compromised.

Data Transmission Encryption
All application data transmitted to and from the client browser is encrypted using the web server's built-in SSL (secure socket layer) encryption. This standard security ensures that no one can see your data as it passes over the public Internet or over your private intranet and local area networks.

Single sign-on using Active Directory
Users of multiple applications will want a single sign-on feature, saving them from having to sign in to each individual application. Iron Speed Designer applications are easily extended to add single sign-on using Active Directory and Lightweight Directory Access Protocol (LDAP).

Referencing Data Access Functions in Code

 

Creates two classes for each table in your database.

The Record classes represent a record from the database.  Some of the record classes specify an actual physical record in the database while others correspond to a virtual record – the result of a join between tables.  A “Record” suffix is added to the name of the table to get the name of the class.  For example, if you have a Customers table in your database, the class will be called CustomersRecord.  The record class is different from the record control class described elsewhere.  A record class corresponds to a database record, while a record control class corresponds to a user interface control that contains other fields that display or edit data.

The Table class is one of the most important classes used in applications.  This class is generated for each table in your application to provide the methods necessary to retrieve a group of records based on a query.  A “Table” suffix is added to the name of the table to get the name of the class.  For example, if you have a Customers table in your database, the class will be called CustomersTable.  A “View” or a “Query” suffix is added to the name if the class is generated for a view or query respectively.

To read data from the database you can use the GetRecords function on the Table class.  There are a number of variations of the GetRecords functions that either take a string based where clause or an object that specifies the clause.  Each of the GetRecords functions can take optional arguments that specify the order by clause, the number of records to retrieve, and the starting page number.

GetRecords with a where clause string

The following examples show how to use the GetRecords functions with a string based where clause.  This case is typically used to make a call to GetRecords when there is only one where clause that is not combined with another clause using an AND or OR operator.  While the clauses can be combined in a string, it is better to use a WhereClause object defined later in this section.

C#:

CustomersRecord[] myRecords;

 

myRecords = CustomersTable.GetRecords("Country = USA");

if (myRecords != null)

{

     foreach (CustomersRecord rec in myRecords)

     {

          // To access a field in the record, simply specify

          //   rec.

          String s = "Company: " + rec.CompanyName;

     }

}

Visual Basic .NET:

Dim myRecords As CustomersRecord()

myRecords = CustomersTable.GetRecords("Country = USA")

 

If Not (IsNothing(myRecords)) Then

     For Each rec In myRecords

           ' To access a field in the record, simply specify

          '    rec.

          Dim s As String = "Company: " & rec.CompanyName

     Next

End If

The GetRecords function takes a WHERE clause and retrieves all records that meet that criteria.  Please note that the number of records returned is dependent on the number of records in the database.  If you want to limit the number of records, you can pass additional parameters to the GetRecords function.  The following code will return the third set of 50 records.

C#:

CustomersRecord[] myRecords;

myRecords = CustomersTable.GetRecords("Country = USA", null, 3, 50);

 

if (myRecords != null)

{

     foreach (CustomersRecord rec in myRecords)

     {

          // To access a field in the record, simply specify

          //   rec.

          String s = "Company: " + rec.CompanyName;

     }

}

Visual Basic .NET:

Dim myRecords As CustomersRecord()

myRecords = CustomersTable.GetRecords("Country = USA", Nothing, 3, 50)

 

If Not (IsNothing(myRecords)) Then

     For Each rec In myRecords

          ' To access a field in the record, simply specify

          ' rec.

          Dim s As String = "Company: " & rec.CompanyName

     Next

End If

The above examples demonstrate how you can read a set of records from the database.  If you want to access the records that are being displayed on a page, you would need to call the GetRecords() function on the Table Control class within the page.

In addition to the above example, you can also use the GetRecord function to read a single record from the database.  GetRecord takes a WHERE clause similar to GetRecords and will return the first record that matches the query.

GetRecords with a WhereClause object

The following examples show how to use the GetRecords functions with a WhereClause object.  This case is typically used to make a call to GetRecords when there are more than one where clauses that must be combined with AND or OR operators.  The CreateWhereClause method generated by Iron Speed Designer uses this method to retrieve data from the database.

You can defined a WhereClause object and then call the iAND and iOR methods to define clauses.  The iAND and iOR methods take a field name, an operator and a value.  The field name may contain spaces or other characters, so it is safer to use the name as provided by the database schema.  The database schema field name can be specified using the Table class followed by the column name such as CustomersTable.CompanyName.

C#:

public virtual void LoadData()

{

     try

     {

          DbUtils.StartTransaction();

 

          // The WHERE clause will be empty when displaying all records in table.

          WhereClause wc = CreateWhereClause();

          this.DataSource = CustomersTable.GetRecords(wc);

     }

     catch (Exception ex)

     {

          throw ex;

     }

     finally

     {

          DbUtils.EndTransaction();

     }

}

 

protected virtual WhereClause CreateWhereClause()

{

     // Start with a blank WhereClause

     WhereClause wc = new WhereClause();

 

     // Create a WhereClause that is as follows:

     // Country = "USA" AND State = "California" AND (Name Contains "Jones" OR CompanyName Contains "Jones")

 

     // Add the value selected in the Country filter dropdown

     if (this.CountryFilter.SelectedValue != "")

     {

          wc.iAND(CustomersTable.Country, EqualsTo, this.CountryFilter.SelectedValue);

     }

 

     if (this.StateFilter.SelectedValue != "")

     {

          wc.iAND(CustomersTable.State, EqualsTo, this.StateFilter.SelectedValue);

     }

 

     // Now we need to create a separate WhereClause that OR's the search string and then

     // this separate clause is ANDed with the rest of the clauses)

 

     if (this.CustomersSearchArea != "")

     {

          WhereClause search = new WhereClause();

 

          search.iOR(CustomersTable.Name, Contains, this.CustomersSearchArea.Text);

          search.iOR(CustomersTable.CompanyName, Contains, this.CustomersSearchArea.Text);

 

          // Now AND this with the WhereClause wc defined earlier.

          wc.iAND(search);

     }

 

     return wc;

}

Visual Basic .NET:

Public Overridable Sub LoadData()

     Try

          DbUtils.StartTransaction()

 

          ' The WHERE clause will be empty when displaying all records in table.

          Dim wc As WhereClause = CreateWhereClause()

          Me.DataSource = CustomersTable.GetRecords(wc)

 

     Catch ex As Exception

          Throw ex

     Finally

          DbUtils.EndTransaction()

     End Try

End Sub

 

Protected Overridable Function CreateWhereClause() As WhereClause

 

     ' Start with a blank WhereClause

     Dim wc As WhereClause = New WhereClause

 

     ' Create a WhereClause that is as follows:

      ' Country = "USA" AND State = "California" AND (Name Contains "Jones" OR CompanyName Contains "Jones")

 

     ' Add the value selected in the Country filter dropdown

     If Me.CountryFilter.SelectedValue <> "" Then

           wc.iAND(CustomersTable.Country, EqualsTo, Me.CountryFilter.SelectedValue)

     End If

 

      ' Add the value selected in the State filter dropdown

     If Me.StateFilter.SelectedValue <> "" Then

          wc.iAND(CustomersTable.State, EqualsTo, Me.StateFilter.SelectedValue)

     End If

 

     ' Now we need to create a separate WhereClause that OR's the search string and then

     ' this separate clause is ANDed with the rest of the clauses)

 

     If Me.CustomersSearchArea.Text <> "" Then

          Dim search As WhereClause = New WhereClause

          search.iOR(CustomersTable.Name, Contains, Me.CustomersSearchArea.Text)

          search.iOR(CustomersTable.CompanyName, Contains, Me.CustomersSearchArea.Text)

 

          ' Now AND this with the WhereClause wc defined earlier.

          wc.iAND(search)

     End If

 

     Return wc

End Function

The GetRecords function takes a WHERE clause and retrieves all records that meet that criteria.  Please note that the number of records returned is dependent on the number of records in the database.  If you want to limit the number of records, you can pass additional parameters to the GetRecords function.  The following code will return the third set of 50 records.

C#:

// By default we want to expand foreign keys and to sort in a case sensitive order

OrderBy orderBy = new OrderBy(true, true);

 

// Order by Name in Ascending order

orderBy.Add(CustomersTable.Name, Asc);

 

this.DataSource = CustomersTable.GetRecords(wc, orderBy, 3, 50);

Visual Basic .NET:

' By default we want to expand foreign keys and to sort in a case sensitive order

Dim orderBy As orderBy = New orderBy(True, True)

 

' Order by Name in Ascending order

orderBy.Add(CustomersTable.Name, Asc)

 

Me.DataSource = CustomersTable.GetRecords(wc, orderBy, 3, 50)

The above examples demonstrate how you can read a set of records from the database.  If you want to access the records that are being displayed on a page, you would need to call the GetRecords() function on the Table Control class within the page.

In addition to the above example, you can also use the GetRecord function to read a single record from the database.  GetRecord takes a WHERE clause similar to GetRecords and will return the first record that matches the query.

I should doing this...

 

 

        

But instead me and my computer right now...

First SharePoint at Devry University in Miramar

   

 

I attended the first SharePoint (Session #1 - Level 100 - June 3rd, 2006) at Devry University in Miramar, Room #240, from 2:00 pm to 5:00 pm this weekend. 

 

I am very impress with  the SharePoint  class today, and  from  Duray Akar's  lecture and I have learned more about:

 

 

1. List items in calendar

 

2. Automatically convert Office documents in SharePoint repository, such as World and Excel to Adobe ® allow distribution of read-only, non-editable copies

 

3. Establish a referential integrity relationship between two SharePoint lists using this web part.

 

4. Simultaneously create SharePoint and Active Directory Users! Allows third party editors, such as Adobe FrameMaker and Autodesk AutoCAD to easily browse the SharePoint repository for viewing.

 

5. Editing, check in/out, and uploading.

 

6. SharePoint list items from multiple areas and web sites into a single view with the ability to display, filter, and sort relevant information

 

7. List Alert Web Part gives users a more flexible way to receive alerts from SharePoint list, such as when tasks are due or when an issue’s status field changes from “Open” to “Fixed”. 

 

Hoped I captured everything... :).

 

Thank you Florida.NET: Dave Noderer, Duray Akar, and Stacy Draper for made this happened.

South Florida Code Camp Feb 2, 2006

       
 

I attended my 1st Code Camp– 2006 South Florida Code Camp, Feb 2, 2006.  Not only did I learn a lot, I had a great time.  I learned which of the presentations I should goto...( I have seen David Silverlight, Alex Funhouse, and Russ Fustino’s presentations many times during the year).

 

I think that I should attend new presenters that I have never seen before, and I did.  I also learned from every session I attended, and from the many conversations I had with other speakers and attendees.  I could easily turn into a Code Camp evangelist (Joe Healy,  and Dave Noderer). 

 

I think it is one of the best ideas in a long time for training and networking within the Microsoft developer community.  I'll give a quick 10 great things about Code Camps (I know I could list many more), but these are the ones that personally benefit me. 

 

Unfortunately, I wasn’t feeling well, I went home early and I knew I missed all others fun in the afternoon, and the Microsoft's Party at night.

 

1.  Free knowledge from folks actually using the product.

2. Choices - I get to choose what topics (and often levels of difficulty) to attend.

3. Opportunity to listened to a friendly group of IT professionals

4. Learn from questions and feedback from the attendees

5. Meeting new friends and peers - I've made new contacts at the Code Camp I have attended

6. Hooking up with old friends - keeping in touch with those I familiar face that I met at the day before prior to last year Code Camps

7. User Group networking - I have found that user groups help other user groups and they really enjoy helping other user groups

8. In Fort LauderdaleFlorida the top prize seemed to be popular this year is “Communities Credits Awards” “marketing material(?)”.

9. Great food (of course)

10. A LOT OF FUN!

 

Geekette maisblogette

 

 

For those of you keeping up with my Geekette maisblogette, I am between jobs again.  No, I didn't get fired; I completed working for SunCruzCasino, Inc.  So what does a geekette do with the time off liked this?  Well, among other things (yeah yeah...geeky things), I decided to catch up on some entertainment.

 

I started with Showtime than HBO.  I have been interested in the show for some times.  Nevertheless, I head on down to the local video rental store (which is not so local, if you take my meaning) and pick up a few episodes.   I have no patient to watch re-run each night.

 

What a cool show!  It is somewhat esoteric but not so much that it's annoying.  It's very strange, but not so strange that it can't be understood.  It's an excellent blend of very vivid characters and extremely well-written dialogue with a stark yet somehow rich backdrop of interweaving tales.  The acting is very good, sometimes even great.  Remember “Sex in the City“? Provides the best performances followed VERY good stars liked ” Sarah Jessica Parker as Carrie Bradshaw, Kim Cattrall as Samantha Jones, Kristin Davis as Charlotte York, and Cynthia Nixon as Miranda Hobbes.

 

One of the key interests I had was Sarah Jessica Parker as Carrie Bradshaw.  I think Sarah Jessica Parker is a very versatile actor and I really enjoy watching her work.  For interestingly enough, however, my favorite character is Charlotte York played by Kristin Davis.   Thought,  I liked the show and I have begun understand how single people.  Dating games liked,  I won't ever want to be part of these games.

 

All in all, I recommend, if not highly, that you see the show.  If nothing else, checks it out on IMDB and HBO.  I am 8 episodes into season one and hope to finish the season over the weekend.  As always, your thoughts on the show are appreciated!

 

 

Many psychics’ stopped me

 

Many psychics’ stopped me in the malls, restaurant, drug stores, bookstores, department stores...etc, and told me about my past love life, and future career, family love life.  All of them made me believed that some evils have came into my life from the past has had harm my life for a long time.   I needed them to unharm all my bad luck so this will help me be lucky again :)

 

The first few times, I believed in some of them, because they with children, or older folks.   For examples:

 

“You are thinking of your soul mate but not your husband, you meant to be with him.  You two met from the past life and thing didn’t work…etc.  You are will be together this life, because he loves you, just because evil has stopped us to be together.  I can help you two got back together“.  “Give me $200, $300, $900…etc“.   None of them got any dimes from me.

 

“Some others told me liked you are always wanted children, and you can't have them  Or “you've always abused and mistreated by your family...etc“.   Does my face look like I was abused and mistreated? Or because I looked stupid enough to get them stop me then see if I have money for them to steal :)?

 

I am very sick of the psychics’.   They are a whole Gang of evils people.   They will make up the story, made you believed that something wrong with you from your past and now but they are all lie just to get your money.

 

I will report to the police next time any of them stop me, and I advice you to do the same,

 

 

 

Hanging in there :)

 

       
 

After liberating myself from every “short-term projects” I find myself briefly* unemployed. Yes, it's true; life is like that for me each time.   I have asked myself:   Where I'll go from here, I dunno :).

What else do I asked? money falls out from the sky after I spent my last paycheck? :) And wait for a laptop gives away? :).   There were so many unwanted vacations so many times.   I liked to go to a real wanted vacations if I have a full time job :)

Are normally jobs this suck anywhere? There are some good people there right? But sadly none of them are in charge?  And yes, there really are evil people in this world?

If you are a Microsoft Certified Database Administrator or Microsoft certified something...  I strongly urge you to run to the opposite direction or be humble as much as humanly possible.   When people interview a MCPs; MVPs…etc, then deny you all opportunities to maintain that status? (“You are little too weak for MCDBA...etc“.  Earn a Microsoft Certification aren't that cheap.  Cost me over $15,000 for Microsoft Training Courses, not included my times and energies).

I am doing the exact same answer the same questions: over and over and expecting a different outcome."  Each time I go for interview. 

I'm pretty sure hanging in there and expecting things to somehow improve would fit that definition.   I like to get me a long term project or better than that  a full time job so I can growth in skills and experiences; howerver; each companies I had been to recently, after I got a hang of my job, I have to leave, because one person of the team didn't like me such as (I ignored his lectures) then I out of job the next day.   

I reused ASP.NET Report in Visual Soursafe(That way we store code in there).   My Director gave me all access rights to Visual Soursafe, this way I can be self learning.  But when my director was on Vacation, the Senior Programmer.  first She deleted all folders that I created for each applications from VisualSourSafe.  Took all my rights away.   I was very sad when saw she gave the new programmer; who has 11 years experiences; all the development tools, but me.  (I like the new programmer a lot) 

I knew,  I won't last there after I told her I was upset with my local server without development tools. my days in the job  was a number and besides I don't speak Spanish like the new person.   Sure enough, when my boss was back to work you should know the rest.

 

 

Saving Data to the Database

 

In the above sections we have discussed the lifecycle of retrieving and displaying data on a web page.  There is an analogous life cycle the page goes through to retrieve the data from the user interface controls into memory and subsequently save this data in the database.

The data is retrieved into memory from each of the user interface controls and validated.  The retrieved data is stored in an instance of the data access layer’s Record class.

The data from the page is retrieved within the record control class, but the transaction is committed at the page level.  This is because data from all records must be saved within a transaction and any foreign key relationships must be taken into account when the data is saved.  For example, master records are saved first followed by child records since the child records need the Id of their parent record.

You can override the SaveData method at the record control or table control to add functionality before or after saving the data. If the Id’s of the records are assigned by the database, they will be available after the data is written to the database and the transaction is committed.  This can be accomplished by customizing the SaveButton_Click method and calling the underlying methods yourself.  Please note that the SaveButton_Click_Base method at the page level contains a call to Redirect after the data is saved, so none of the code after a call to the base method will be executied.

If the button action specifies redirection to another page, the Redirect method is called within the Save button’s click handler.  The Redirect method of the base class will automatically change the URL parameters if they have been specified in the Properties dialog box.

 

Calling Hierarchy of a Page with a Record Control when Saving Data

The calling hierarchy of a page with a record control when saving data shows the various methods that are called at the Page and Record Control class levels.  When saving data, most of the work is performed by handling the Click event of the button at the page class level.  The Click event is handled by ButtonClick and ButtonClick_Base methods at the page level.  The ButtonClick_Base method then calls the SaveData method for each of the Record Control classes on the page.  Since you may be only editing a subset of fields on the page, LoadData is called to load the complete record and perform concurrency comparison.  This is followed by a call to Validate the data entered by the user and GetUIData to retrieve the data from the user interface controls into the database record.  The record is then saved in the database.  The CommitTransaction is performed at the ButtonClick_Base to ensure that all of the data is saved within one transaction.

Table Control and Record Control Lifecycle

 

The Table Control and Record Control are user interface controls and have a lifecycle of their own, just like the lifecycle of each of the controls on a page.  It is important to understand the lifecycle of the table and record control classes since the page delegates the responsibility of reading the data from the database and retrieving and validating the data from the user interface prior to saving it in the database.

The query used to read data from the database is a composite query that is formed based on the static WHERE clause specified by the developer and the dynamic settings specified by the end user.  The static query might be:

SELECT  *

FROM Customers

WHERE Customers.State = California

When the end user views the information, he or she might search for some information within the table, further filter by another field, sort by a column and display the third page of information.   In this case, the pseudo-query might look something like:

SELECT    rows 31 to 40

FROM Customers

WHERE Customers.State = California AND

     Customers.LastName LIKE ‘%Smith%’

ORDER BY Customers.ZipCode DESC

During the lifecycle of a table or record control, you have an opportunity to further modify the query before it is executed by overriding the CreateWhereClause method.  You can also review the data retrieved and make any changes before presentation to the user, or calculate values that are dependent on the rows retrieved by overriding the DataBind method.   Please note that the query only returns the rows that are being displayed on the web page, not all of the rows that would be returned by the query.  For example, if each page displays 10 records, and page 4 is being currently displayed, the query will return only records 31 through 40.

 

Calling Hierarchy of a Page with a Table Control when Displaying Data

The calling hierarchy of a page with a table control when displaying data shows the various methods that are called at the Page, Table Control and Record Control class levels.  When displaying data, most of the work is performed by handling the Load event at the page class level.  The Load event is handled by Page_Load, LoadData and LoadData_Base methods at the page level.  The LoadData_Base method then calls the LoadData and DataBind methods for each of the Table Control classes on the page.  LoadData then calls CreateWhereClause to create the clause that is used to read the data from the database.  The DataBind binds the data to the user interface controls and also binds the pagination controls.  Any dropdown filter lists are populated by calling the PopulateFilter methods.

 

Calling Hierarchy of a Page with a Table Control when Filtering, Sorting or Searching Data

The calling hierarchy of a page with a table control when filtering, sorting or searching data shows the various methods that are called at the Page, Table Control and Record Control class levels.  When filtering, sorting or searching data, most of the work is performed by the PreRender method at the Table Control class level.  The PreRender method takes the settings set earlier by one of the Click or SelectedIndexChanged events at the Table Control class level.  PreRender then checks to see if the data needs to be reloaded and calls the LoadData and DataBind methods for the Table Control class.  LoadData then calls CreateWhereClause to create the clause that is used to read the data from the database.  The DataBind binds the data to the user interface controls and also binds the pagination controls.  Any dropdown filter lists are re-populated by calling the PopulateFilter methods.

 

Calling Hierarchy of a Page with a Record Control when Displaying Data

The calling hierarchy of a page with a record control when displaying data shows the various methods that are called at the Page and Record Control class levels.  When displaying data, most of the work is performed by handling the Load event at the page class level.  The Load event is handled by Page_Load, LoadData and LoadData_Base methods at the page level.  The LoadData_Base method then calls the LoadData and DataBind methods for each of the Record Control classes on the page.  LoadData then calls CreateWhereClause to create the clause that is used to read the data from the database.  The DataBind binds the data to the user interface controls.  Any dropdown lists used on the record page is also populated by calling the PopulateFieldDropDownList method from DataBind.

Page Code Customization Model

 

There are four types of classes that are generated.

Page code-behind class

The page’s code-behind class is derived from the Microsoft .NET Framework’s page class.  This class contains event handlers and methods that load the data from the database, display the data in user interface controls and save the updated data back into the database.  The page class event handlers and methods call on some of the other classes to actually perform the specific task.  Most of the code customization should be performed in these other classes.

 

Sample Add Customers page showing the page code-behind class and a record control class (described below).

Microsoft .NET Framework does not provide the flexibility of sub-classing of page classes where the controls are defined at both the base class and the sub-class.  To provide the ability to customize the generated code, Iron Speed Designer creates a Base method for each of the methods.  For example, Iron Speed Designer generates LoadData and LoadData_Base.  LoadData calls LoadData_Base to perform the actual work.  LoadData can be customized, while LoadData_Base should not be modified.  LoadData can call perform additional work before or after the call to LoadData_Base, or the entire call to LoadData_Base can be replaced with custom code in LoadData.

 

Some of the key methods generated in the page class are:

  • Page_Load: Calls Authorize to verify if user has access to the page, and then calls LoadData to load the data. 

  • LoadData and LoadData_Base: LoadData calls the LoadData_Base method which in turn calls each of the record and table controls to actually load the data for the respective controls.  The Base method (LoadData_Base) should not be modified, LoadData can be modified to perform additional tasks before or after the call to LoadData_Base or to simply replace the call.

  • Button_Click and Button_Click_Base: These methods handle the click event of a button and are named based on the name of the button.  For example, a button called SaveButton will have a SaveButton_Click and a SaveButton_Click_Base method generated as part of the page class.  The SaveButton_Click calls the SaveButton_Button_Click method which in turn calls each of the record and table controls to actually save the data for the respective controls.  The Button_Click_Base method starts, commits and ends a transaction and all updating of data occurs within this one transaction.  Any errors including validation errors are reported by the lower level methods by throwing an exception. The exception is caught in Button_Click_Base and a Javascript alert is registered for display during the subsequent page load.

Record control class

If a page contains a record control such as an Add or Edit record page, a record control class provides the methods necessary to load the data for the specific record and bind its data to the user interface control.  There are two record control classes created for each record on the page.  A Base record control class contains all the generated code and is named by prefixing “Base” to the name of the record control (e.g., BaseCustomersRecordControl).  An initially empty “safe” class is also generated and is named the same as the name of the record control (e.g., CustomersRecordControl).  Any methods defined in the base class can be overridden in the safe class to customize the functionality of the record control.

Some of the key methods generated in the record control class are:

  • LoadData: Load the data from the database based on the query specified on the record panel wizard.  This method calls the CreateWhereClause to compose the where clause that will be used to read the data from the database.

  • CreateWhereClause:  For Edit Record and Show Record pages, the CreateWhereClause retrieves the URL parameter and constructs a Where Clause to read the record from the database.

  • DataBind: Binds the record read from the database to the user interface controls.  Any formatting of the data such as the conversion of the stored date into a local culture specific date format is performed in this method.

  • SaveData: This method calls Validate to perform additional validation of the data, retrieves the data from the user interface controls, and then saves the data in the database.  The transaction must be started prior to a call to this function, and must be committed by the caller.  This method calls the Parse method to parse the value from the user interface control into the database record.  The Parse method first performs validation to ensure the value can be recognized based on the type of the field (e.g., date), and then, if necessary, converts the text value to the data type of the field (e.g., integer).  The Parse method may throw an exception if the value is not recognized.  The exception must be handled by the caller of the SaveData method.

  • Validate: An initially empty Validate method is generated in the Base class.  You can override this method in the safe class to perform additional validation.  In case of an error, an exception must be throw with an appropriate message that can be reported to the end user.

Table control class

If a page contains a table control such as a Show Table page, the table control class provides the methods necessary to load, display, filter, search, sort, and paginate the table data.  There are two table control classes created for each table on the page. A Base table control class contains all the generated code and is named by prefixing “Base” to the name of the table control (e.g., BaseCustomersTableControl).  An initially empty “safe” class is also generated and is named the same as the name of the table control (e.g., CustomersTableControl).  Any methods defined in the base class can be overridden in the safe class to customize the functionality of the table control.

In addition to the two classes for each table control, there are two additional classes created that correspond to a row in the table.

 

Sample page showing a page class, a table control class and a row class (described below).

Some of the key methods generated in the table control class are:

  • LoadData: Load the data from the database based on the query specified on the table panel wizard.  This method calls the CreateWhereClause to compose the where clause that will be used to read the data from the database.  CreateOrderBy is called to create the ORDER BY portion of the SELECT where clause.  Both CreateWhereClause and CreateOrderBy methods can be overridden in the safe class to add, modify or replace the generated code.  The LoadData method sets the DataSource of the Table Control class.  The DataSource is used later by the DataBind method to bind each of the rows in the table.

  • CreateWhereClause: The CreateWhereClause composes and returns a Where Clause.  The Where Clause is composed of the static where clause defined at page creation time combined with any filtering and searching criteria specified by the end user.  You can add additional clauses by overriding the CreateWhereClause method.

  • DataBind: Binds the record read from the database to the user interface controls.  This method loops through each row in the table, sets the DataSource of the row record control to the specific row from the DataSource of the table control, and then calls the DataBind method of the row record control.  Any formatting of the data such as the conversion of the stored date into a local culture specific date format is performed in this method.  Pagination controls are bound by calling BindPaginationControls method.  The data for any drop-down filter controls is loaded and bound in this method by calling Populate methods for each filter.

  • SaveData: This method is applicable to editable tables and calls the SaveData method for each of the row record controls in the table.  This method also deletes and rows if the user deleted the row.  The row is deleted from the database when the Save button is clicked, not when the delete button is clicked. The transaction must be started prior to a call to this function, and must be committed by the caller.  See the SaveData method for the Record Control described above.

  • BindPaginationControls:  All of the pagination controls are bound in this method.  Some controls are disabled if they are not applicable, such as the first page button if the user is already on the first page of the table.

  • PopulateFieldFilter:  For every dropdown filter, there is a PopulateFilter method generated.  The name of the method is of the form PopulateFILTERNAMEFilter.  For example, if there is a Country filter, the method generated will be called PopulateCountryFilter.  This method first calls the CreateWhereClause method for the specific filter (e.g., CreateWhereClause_CountryFilter), and then reads the data from the database, initializes the dropdown list with the values returned, and sets the selected value based on the current value specified in the database.  By default, a maximum of 500 items are retrieved from the database.  This can be changed by modifying the MaxDisplayedValues attribute on the Page Properties dialog box for the specific filter control. 

The CreateWhereClause_FILTERFilter method can be overridden to add, modify or replace the generated method. This is the best way to display a subset of items in the filters. Please note that the filter is a Display Foreign Key As field, the query may be run on the foreign key table, and not on the table from where the data is being displayed.  This is based on the setting on the Page Properties dialog box that determines whether All Values or Only Result Set is selected for the filter settings.  For example, if you are displayed the Order Details table containing a Product Id filter that is a foreign key to the Products table, then the Populate method will retrieve data from the Products table if the All Values option is selected.  If the Only Result Set option is selected, then the Populate method will retrieve data from the Order Details table.  Please take this into consideration when modifying the CreateWhereClause_FILTER methods so you can add the right WHERE clause for the applicable table.

  • Sort_Click:  For every column sort hyperlink in a table control, there is a Click handler generated.  The name of the click handler is of the form COLUMNNAME_Click.  For example, if there is a Country1 column header, the method generated will be called Country1_Click.  This method calls the underlying ColumnSort method to set the CurrentSortOrder variable that will be used later by the CreateOrderBy method to set the sorting column and direction.

Row class

If a page contains a table control, then in addition to the table control classes, two additional classes are created.  These classes correspond to a row in the table.  The row classes are exactly the same as the Record Control classes defined above with one difference. 

It is important to note that the row classes do not load the data from the database individually, but instead rely on their DataSource variable being set by the table control’s DataBind method.

Page Control Hierarchy

 

All web pages in Microsoft .NET Framework contain a number of user interface controls that are initialized at the server side and are called server controls.  Since server controls can have children, and each of their children may have children, and so on, a control and its descendents form a tree of controls.  This tree of controls is called the control hierarchy. The root of the control hierarchy for a .NET web page is the Page-derived class.  Iron Speed Designer generates a hierarchy of controls for each of the pages. 

The loading of the data from the database is delegated by the page to the Table Control or the Record Control classes.  Since you can have a number of tables and records displayed on a page, there can be multiple Table Control and Record Control classes within a page.  Each of the classes is responsible for loading its data from the database based on the query you specified and any search, filter and pagination settings selected by the end user.  The Row record control class does not load data directly from the database, but receives its data from the Table Control class.

The dropdown filter controls load the data from the database directly in methods that are named PopulateFILTERNAME.

The field value controls do not load data from the database directly.  Instead they rely on the Table Control and Record Control classes to load the data and are bound in the DataBind methods for each of the table or record control classes.

The Page Lifecycle

 

Creates standard web pages that are derived from the ASP.NET Page class.  When an ASP.NET web page is requested from the web server, the code-behind class for the page goes through a sequence of steps to initialize and load the user interface controls, read the data from the database and display the page.

This sequence of steps is called the page lifecycle as shown below:

  • Initialization:  During this stage the page and all of the controls within the page (control hierarchy) are instantiated.  This includes any tables, textboxes and buttons.  Any event handlers to handle click events for buttons, sorting hyperlinks, and text changed events for filters are initialized at this stage.

  • Loading: The data being displayed or edited on this page is loaded from the data-source and “bound” to each of the user interface controls.  The binding process involves formatting the information as well as loading any additional information needed such as the contents of drop-down lists.  Most of the work is performed during this step.

  • Event Handling: Post-back events caused by server controls will be handled. These event handlers include events such as button clicks, SelectedIndexChanged of a dropdown list, TextChanged of a textbox and sorting hyperlink events, Note that when button clicks happen, the Init and Load event handlers will be executed as well.  Iron Speed Designer generates code for the Init and Load handlers that checks for the IsPostBack property before deciding whether to execute any code.  As generated, the Init and Load handlers do not execute any code during event handling since the code is surrounded by If Not(Me.IsPostBack), so the event handler must perform all actions including loading data from the database if necessary.

  • Rendering: The HTML of the page and all controls are sent to the browser for rendering.  Iron Speed Designer generates code for the PreRender method that checks to see if this is the first time a page is being displayed or whether this is a postback caused by an event such as a button click.  During the initial page lifecycle when the page is first being displayed, the PreRender method does not perform any actions.  During event handling postbacks, PreRender checks to see whether any data is required to be reloaded because of button clicks or other events.  If the data needs to be loaded again based on the new settings, PreRender calls LoadData to retrieve data from the database.

All pages generated derive from the Microsoft .NET Framework’s Page class, so they follow the same page lifecycle described above.  The classes generated extend the Page class to support loading data from the database and to provide more enhanced user interface controls that support data type formatting and validation.

Overrides and Events

At each state of the page lifecycle, the Microsoft .NET Framework sends an event notification to the page.  You can handle an event to customize any aspect of the page before it is displayed to the user.  By handling an event, you can add functionality to your page, but cannot replace the existing functionality that is already provided by the underlying classes.

You can define any number of event handlers for a single event.  For example, the Init event can be handled by multiple event handlers.  In general, if you want to add functionality, it is better to define your own event handler, rather than modifying an existing event handler.  Note that the order of calling of event handlers for an event is not guaranteed.  The event handlers may be called in any order, so care must be taken to ensure that there are no dependencies betweem event handlers for the same event.

Note that event notifications are sent after the completion of each phase.  For example, the Init event is sent when the initialization of all the controls is complete and the Load is sent after the loading of the data and the controls of the page is completed.

Iron Speed Designer generates code to handle these standard events such as Init and Load.  The generated code then calls other methods to perform the specific tasks such as loading of the data or binding data to the user interface controls. 

You can customize or change the behavior of any control by either:

  • Adding your own event handler:  If the goal is to add to the functionality, you can simply add your own event handler.

  • Changing the generated event handler or method:  Generates code in two sections.  Section 1 is generated once, and never overwritten.  Section 2 will be overwritten whenever controls are added, modified or deleted.  All generated event handlers are in Section 2 and should not be modified.  To customize the behavior, Iron Speed recommends modifying the methods that are called by the event handlers.  These methods are defined in Section 1 and can be modified easily.

  • Overriding the generated method:  Any of the generated methods can be overridden in the sub-classes.  The sub-classes generated in Section 1 will not be overwritten, so the behavior can be easily customized by overriding the method in one of the subclasses.  Unlike event handling, overriding a method for a class allows you to replace the underlying functionality being performed.  For example, you can override the LoadData method of a record control class to read the data from the database and bind it to each of the controls.  If you override a method, you have a choice of calling the base method or simply replacing all of the functionality provided by the base class.

Each of the generated files contains two regions.  The first region is generated once and never overwritten.  This is called Section 1 and may also be referred to as the “safe” region of a file.  The second region may be regenerated during a rebuild and should not be modified.  This is called Section 2 and may also be referred to as the “gen” region of a file.

C#:

#region "Section 1: Place your customizations here."

 

     // Contains derived classes - you can override any method defined in inheritted classes.

     // Contains methods that can be modified.

 

#endregion

 

#region "Section 2: Do not modify this section."

 

     // Contains classes and methods that should not be modified.

     // Everything in this section may be overwritten during a rebuild.

 

#endregion

Visual Basic .NET:

#Region "Section 1: Place your customizations here."

 

     ' Contains derived classes - you can override any method defined in inheritted classes.

     ' Contains methods that can be modified.

 

#End Region

 

#Region "Section 2: Do not modify this section."

 

     ' Contains classes and methods that should not be modified.

     ' Everything in this section may be overwritten during a rebuild.

 

#End Region

What is Atlas?

 

What is Atlas?

The Atlas features of ASP.NET are not just another AJAX script library for writing client-centric Web applications. Atlas builds on the .NET Framework 2.0 and adds support for better utilizing the capabilities of client-side JavaScript and the XMLHttpRequest object. It includes server-based features that make it easy to enrich existing ASP.NET applications, as well as a client script library that is used by the Atlas controls and services. The architecture diagram in Figure 1 shows that the Atlas architecture extends across client and server and should be viewed as a broad set of development technologies for creating richer, more responsive cross-browser Web applications.

Figure 1 ASP.NET Atlas Architecture
Figure 1 ASP.NET Atlas Architecture

Scenarios enabled by Atlas are not limited to updating regions of the page with an asynchronous JavaScript call. You also get richer client experiences that would otherwise be impractical. For example, consider a Web application built around movie data. The application might want to allow users to search for a specific actor. Obviously it wouldn’t be practical to provide a comprehensive dropdown list of all actor names to choose from, so the application would probably break the problem down. Users might be asked to select the first letter of the actor’s name. A request to the server could then provide a list that would be somewhat more manageable, but the user experience is not great. The application could present the user with a textbox to enter in part of the actor’s name. The server would then at least have some data to use in narrowing the search. This is better, but still leaves room for improvement. With Atlas you could provide a textbox that reacts dynamically as the user types to help narrow the search without waiting for the browser to refresh the whole page. Figure 2 shows how you could use Atlas to add autocomplete behavior that provides feedback as the user types.

Figure 2 Filtering Combobox
Figure 2 Filtering Combobox

The Atlas CTP is available as a download from atlas.asp.net. When installed, it adds an additional Web Site template for C# and Visual Basic® .NET to Microsoft Visual Web Developer™. When you create a new Web site project in Visual Web Developer (click File, then New, then Web Site), you will see a dialog like the one shown in Figure 3. The Atlas Web site includes Microsoft.Web.Atlas.dll and an updated web.config file that configures the Web application to be able to use Atlas-based ASP.NET features. In the current release, Microsoft.Web.Atlas.dll is placed in the bin directory of the application as a local assembly available throughout the application.

Figure 3 Creating an Atlas Web Site
Figure 3 Creating an Atlas Web Site

Atlas-based applications can be easily deployed by copying the files from a development machine to a server with ASP.NET 2.0 without worrying about separately installing Atlas. The installation is at the application level instead of machine level. As subsequent CTP releases become available, they can be used on a machine with older versions of Atlas even as the features evolve and change. This provides more flexibility in migrating to newer versions than if the installation were systemwide.


The Atlas Architecture

The first thing to notice about the Atlas architecture diagram shown in Figure 1 is that it spans both client and server. ASP.NET 2.0 added some additional client features but not to the extent that Atlas does. On the right side of the architecture diagram, notice that Atlas server features are built on top of ASP.NET 2.0 and extend its capabilities. Atlas includes a new set of server controls as well as new features aimed at accessing server-based data and services from the browser.

On the left you’ll see a comprehensive client script library, which can be used independently of the server features in writing client-centric JavaScript. It is the foundation on the client that is used heavily by the new Atlas features to enable richer application development with improved client-server interactions.

In Figure 4 you can see the typical client-server interaction in a Web application. First, a page is requested by the browser and the user interacts with it. When some action from the user requires data from the server, a complete page refresh occurs to update part of the page based on their input. Unfortunately, this behavior does not allow the user to continue interacting with the page. Instead, the user must pause continuously while working with the Web application.

Figure 4 Typical Client-Server Interaction
Figure 4 Typical Client-Server Interaction

Figure 5 shows that client-server interaction with Atlas shifts away from complete page refreshes. Instead, the initial HTML is retrieved and subsequent calls to the server get updated data in XML, JavaScript Object Notation (JSON), or snippets of HTML to update the page incrementally. The background asynchronous calls can invoke Web services or retrieve page changes without leaving users feeling that they must pause. These asynchronous calls manage updated view state information for subsequent server postbacks so that when a complete page refresh is necessary, the accurate state of the page is carried to the server.

Figure 5 Atlas Client-Server Interaction
Figure 5 Atlas Client-Server Interaction

The Client Script Core Library

The Atlas client script library is delivered to the browser as several distinct pieces. The script core comprises the bottom layers on which the rest of the library is built. At the base is the browser compatibility layer. A key feature of Atlas is that it will run on the modern browsers that support the key elements of AJAX. In the CTP builds, this support has included Mozilla Firefox, Apple Safari, and Microsoft Internet Explorer®. The browser compatibility layer is an abstraction that allows you to write script with less worry. It hides the details of where the browser implementations differ. It also allows for Atlas support to be easily augmented as the browsers evolve and as new versions are released. The type of browser making a request automatically determines what browser-specific parts of the compatibility layer are used. The higher-level code has been written to the abstraction layer, so you don’t need to code around variations in browser implementations.

On top of the compatibility layer is the core type system. The type system allows for an object-oriented approach to JavaScript development. It gives the developer working in JavaScript the ability to create namespaces and add classes to them. It also simulates object inheritance. There is support for interfaces, delegates, and enumerations, which makes it easier to switch back and forth between developing code on the server in an object-oriented programming language like C# and writing JavaScript code on the client.

The base class library layer built on top of the type system completes the core of the client script library. The concept is borrowed from the .NET Framework and exposes some familiar types. There is an Event object that supports multicasting of events in a natural way in JavaScript. There is a StringBuilder object, too. There is also support for object serialization, including support for JSON and XML data. The base class library also includes WebRequest and WebResponse classes that provide an abstraction over the browser’s XMLHttpRequest object similar to those found in the System.Net namespace in the .NET Framework. The code in Figure 6 demonstrates creating two simple types in JavaScript using the Atlas script core. The Movie type that is created first exposes properties for the movie title and its genre as well as a toString method. The Drama type then extends the Movie type and overrides the toString method.

The page that uses the Movie and Drama types is shown in Figure 7. It first references the .js file where the types are defined in an Atlas ScriptManager control. Then, in the Click handlers, the page creates instances of the Movie and Drama types and calls their toString methods. The inheritance behavior is what you would expect to see from any object-oriented programming language, but the code that is running happens to be dynamic JavaScript. Another nice aspect of the current Atlas installation is that debug versions of the client script library are included to make debugging and troubleshooting easier. Debugging JavaScript has always been cumbersome, so this may ease the pain.


Client Script Controls and Components

Above the layers that make up the client script core of the Atlas architecture are the component model and controls layers. This part of the script library builds on top of the script core underneath it, but is rendered to the client separately. You could choose not to include the component layer and instead just use the JavaScript type system and base class library directly when writing script, but you would not have access to the client components provided by Atlas and would not be able to use xml-script, which is a new set of declarative elements contained in the page markup that is sent to the browser. The xml-script elements are contained in a script tag that uses the new type value: