ASP.NET
  Home arrow ASP.NET arrow ASP.NET Architecture, Part 2
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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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 2
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 15
    2004-03-03

    Table of Contents:
  • ASP.NET Architecture, Part 2
  • The Global.aspx.vb File
  • Creating a Web Form
  • Creating User Controls
  • Adding Controls
  • Server Control Types and Web Controls
  • Error Handling and Security

  • 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 2


    (Page 1 of 7 )

    In this second of a two-part series, Dwight takes us through the new ASP.NET Architecture. We learn about ASP.NET's System.Web.UI namespace classes, interfaces, enumerations, and delegates. We also learn about the ASP.NET page class, including a close look at the life cycle of an ASP.NET page, applying page directives, and the code-behind feature. This piece comes from chapter six of February's Developer Shed Writing Contest prize, .NET & J2EE Interoperability, by Dwight Peltzer (McGraw-Hill/Osborne, ISBN 0-07-223-054-1, 2004).

    .NET & J2EE InteroperabilityDefining Web Form Functionality

    Let’s create a new project in Visual Studio .Net. Begin by creating a virtual directory called MyASP.NETPages. Then open Visual Studio .NET and create the new ASP.NET web application project called IFCE. Initially, the location where the application will be stored looks like this: http://localhost/WebApplication1. Rename it to the correct project name, “IFCE.” Also, rename public class1 to Register. Notice how public class Register inherits from class System.Web.UI.Page. The next item of interest, Private Sub InitializeComponent(), calls the subroutine InitializeComponent(). Next, Private Sub Page_Init(ByVal sender as System.Object, ByVal e as System.EventArgs) Handles MyBase.Init initializes the page.

     
    Public Class Register 
      Inherits System
    .Web.UI.Page 
    #Region "Web Form Designer Generated Code" 
      'This call is required by the Web Form Designer. 
      <System.Diagnostics.DebuggerStepThrough()> 
      Private Sub InitializeComponent() 
      End Sub 
      'NOTE: The following placeholder declaration 
      is required by the Web Form Designer. 
      'Do not delete or move it. 
      Private designerPlaceholderDeclaration As System.Object 
      Private Sub Page_Init(ByVal sender As System.Object, 
      ByVal e As System.EventArgs) Handles MyBase.Init 
          'CODEGEN: This method call is required by the Web Form Designer 
      'Do not modify it using the code editor. 
          InitializeComponent () 
       End Sub 
    #End Region 
    End Class 

    WebForm1.aspx displays the code-behind feature. Inside the ASP.NET script delimiters, the page language is VB; the CodeBehind is Web Form1.aspx.vb. The code indicates that the web form inherits from the IFCE WebForm1. The form ID is Form1; the method is Post, specifying that the page must run on the server.

    %@ Page Language="vb" AutoEventWireup="false" 
    Codebehind
    ="WebForm1.aspx.vb" Inherits="IFCE.WebForm1"%> 
    <html
      
    <head
        
    <TITLE>WebForm1</TITLE
        
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"
        
    <meta name="CODE LANGUAGE" content "Visual Basic .NET 7.1"
        
    <meta name="defaultClientScript content="JavaScript"> 
        <meta name="
    vc_targetSchema content="http://schemas.Microsoft.com/ 
    intellisense/ie5"

      
    </head
    </html
    <body MS_POSITIONING="GridLayout"
        
    <form id="Form1" method="post" runat="server> 
        </form> 
      </body> 
    </html> 

    Next, click on the Register icon in the Solution Explorer and select View Designer. Then, click on the Toolbox icon and drag a label onto the web form. Select the label’s properties and type RegisterClient to the right of the text property. Finally, compile the application, and the label will display in Internet Explorer as follows:

    Register Client

    This has been part two of ASP.NET Architecture (see part 1 here), 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

    - ASP.NET DotNetNuke Installation with Visual ...
    - Using ASP.NET with a MySQL Database
    - Using ASP.NET with an MS Access Database
    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 10 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek