ASP.NET
  Home arrow ASP.NET arrow Page 7 - ASP.NET Architecture, Part 1
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

ASP.NET Architecture, Part 1
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 25
    2004-02-23

    Table of Contents:
  • ASP.NET Architecture, Part 1
  • ASP.NET Namespaces
  • System.Web.UI Namespace Classes
  • System.Web.UI Namespace Interface, Enumerations, and Delegates
  • ASP.NET Page Class
  • An ASP.NET Page's Life Cycle
  • Applying Page Directives
  • Code-Behind Feature

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    ASP.NET Architecture, Part 1 - Applying Page Directives


    (Page 7 of 8 )

    Most likely if you are a classic ASP developer, you have used directives such as @ Include and @ Language. The @ Include directive instructs the ASP runtime to include a particular file inline with the page. The @ Language directive tells the runtime to employ a specific script interpreter located within the <% %> render blocks. Directives provide easy ways for developers to determine declaratively how various aspects of an application will ultimately behave. For example, in addition to the @ Language directive, classic ASP provided only four directives:

    1. @ Codepage Used in globalization to set the code page for an ASP page
    2. @ EnableSessionState Used to disable session state for a specified page
    3. @ LCID Used to set the locale identifier for an ASP page
    4. @Transaction Used to specify how a page participates in COM+ transactions

    ASP.NET has added numerous directives for controlling page behavior, page configuration, and many other tasks. Table 6-1 presents a partial list of new directives included with ASP.NET. Note that in the Values column, T/F stands for true or false.

    Attribute

    Values

    Meaning

    @ Page

    T/F

    Defines page-specific attributes used by ASP.NET compilers and the CLR to determine page behavior.

    AutoEventWireup

    T/F

    Default is set in the <pages> segment of the Machine.config or Web.config file

    Determines whether handlers are set up automatically. Default is true.

    Buffer

    T/F

    Specifies whether rendered output is buffered before sending it to clients, or sent as it is rendered.

    ClassName

    Can be any class name

    Determines name of page when dynamically compiling the page. This works either with or without CodeBehind.

    CodeBehind

    File name of CodeBehind class

    Visual Studio .NET uses this attribute for locating the CodeBehind class and compiling during a build operation. ASP.NET does not use this attribute.

    CodePage

    Any code page

    The same in both ASP and ASP.NET.

    CompilerOptions

    A string containing valid compiler options

    Allows developers to specify compiler options for a specified page.

    ContentType

    Any valid MIME type

    Sets the MIME type for page output.

    Debug

    T/F Default is set in the <compilation> section of the Machine.config or Web.config file

    Determines whether pages are compiled with debug symbols or not. Default is false.

    Description

    Any string

    Provides a text description of the page. The ASP.NET runtime ignores this attribute.

    EnableSessionState

    T/F Default is set in the <pages> section of the Machine.config or Web.config file

    Determines whether a page request initiates a new session and whether or not the page can access or modify data saved in an existing session. Default is true.

    EnableViewState

    T/F Default is set in the <pages> section of the Machine.config or Web.config file

    Specifies whether ViewState is enabled for the page. Default is true.

    EnableViewStateMac

    T/F Default is set in the <pages> section of the Machine.config or Web.config file

    Determines whether ASP.NET executes a machine authentication check on the content of a hidden form field that is used to store ViewState and to ensure it is not modified on the client. Default is false.

    Table 1 ASP.NET Page Directives

    NOTE: The list of directives in Table 1 is incomplete. Many other equally important directives exist, such as Inherits, ResponseEncoding, LCID, Strict, and Transaction. You can search for these directives in Visual Studio .NET Help.

    Here is a brief example of how you would use the Page directive:

    <%@ Page debug="true" %>

    Another example sets the trace directive:

    <%@ Page trace="true" %>

    Other directives include the @ Implements directive, employed to implement a defined interface from within an ASP.NET page. In addition, use the @ Register directive to register user controls and custom server controls on an ASP.NET page.

    Come back this Friday, 27/02/2004, for part two of ASP.NET Architecture. This is chapter six of .NET & J2EE Interoperability, by Dwight Peltzer (McGraw-Hill/Osborne, ISBN 0-07-223054-1, 2004).
    Buy this book now.

    More ASP.NET Articles
    More By McGraw-Hill/Osborne


     

    ASP.NET ARTICLES

    - Developing a Mini ASP.NET AJAX Server Centri...
    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT