ASP.NET
  Home arrow ASP.NET arrow ASP.Net Application
Iron Speed
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 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
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 Application
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 32
    2004-12-15

    Table of Contents:
  • ASP.Net Application
  • ASP.NET Mobile Web Applications
  • Application Structure and Boundaries
  • Application Boundaries
  • Application File Types
  • global.asax Files
  • .aspx Files
  • Code-Behind and Class Files

  • 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

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    ASP.Net Application


    (Page 1 of 8 )

    ASP.NET improves on the type of application that developers could use in classic ASP, and adds a new application, called a webservice. Read this article to learn more about the new application, which lets clients use the functionality of a particular application without needing to use the application's specific user interface. The article is excerpted from chapter two of ASP.NET in a Nutshell, by G. Andrew Duthie. (O'Reilly, 2003, ISBN: 0596005202).

    In Chapter 1, we introduced the .NET platform, some of its most important concepts, and new features available in ASP.NET. In this chapter, we’ll look at the types of applications you can create with ASP.NET, discuss when you might want to use one type over another, explore the structure of ASP.NET applications, and look at the various file types that make up an ASP.NET application.

    Application Types

    In classic ASP, there was really only one type of application—one in which a client accessed a page with the .asp extension and in which that page, either through embedded VBScript or JScript or through script in combination with components built on Microsoft’s COM standard, returned HTML to the browser to form the user interface with which the client would interact. Clients typically interacted with the application only through this user interface and did not have the option of creating their own alternative interface to the functionality exposed by the application.

    ASP.NET provides an enhanced version of this type of application, which we’ll discuss in the next section. ASP.NET also introduces a new type of application, called a webservice, which provides clients the ability to use functionality exposed by an application without being tied into that application’s user interface implementation.

    ASP.NET Web Applications

    The ASP.NET Web Application is the type of application most developers will work with on a regular basis. The terminology comes from the description used in the Visual Studio .NET environment to describe the project type used to create this type of application. You may also hear this type of application described as an ASP.NET Web Forms Application. For reasons we’ll explore in the next chapter, we prefer the former term.

    An ASP.NET Web Application, in its simplest form, consists of a directory made available via HTTP using the IIS administration tool or through the Web Sharing tabof a folder’s Properties dialog (or by creating a webapplication project in Visual Studio .NET) and at least one ASP.NET page, designated by the .aspx file extension. This file (or files), whose structure we’ll discuss in detail in the next chapter, typically contains a mix of HTML and server-side code. This HTML and server-side code combine to create the final output of the page, typically consisting of HTML markup that is sent to the client browser. A simple ASP.NET page is shown in Example 2-1.

    Example 2-1 . A simple ASP.NET page

    <%@ Page Language="VB" %>
    <html>
    <head>
      <title>Simple ASP.NET Page</title>
      <script runat="server">

        Sub Page_Load()

          Message.Text = "Hello, world!"

        End Sub

      </script>
    </head>
    <body>

    <asp:Label id="Message" Runat="server"/>

    </body>
    </html>

    The page shown in Example 2-1 simply executes the code appearing in the <script runat="server">, which uses an ASP.NET Label control to display some text, along with the standard HTML tags that are contained in the file. Figure 2-1 shows the output of the page as viewed in Notepad by using the View Source option in Internet Explorer. In this case, the Page_Load method (actually an event handler, which we’ll discuss more in later chapters) sets the Text property of an ASP.NET Label control to “Hello, world!”. Because the Label control will render its Text property to the browser automatically, “Hello, world!” will appear in the output that is sent to the browser, as shown in Figure 2-1.

    The key to understanding how ASP.NET Web Applications work is understanding that the code in a <script runat="server"> block (or a <% %> render block) is executed on the server—after the client requests the page, but before the output of the page request is sent to the client browser. This allows developers to decide, based on the code they write and the input received from the user, just what output actually is sent to the browser, either directly (such as by calling the Write method of the Response object) or by manipulating controls, as shown in Example 2-1. It also allows additional functionality, such as server-side state management, to be provided to these applications.


    Figure 2-1.  Output of a simple ASP.NET page (source view) 

    Web Forms and Web Controls

    Example 2-1 uses a control called the Label control to output text to the browser. This control is an example of what are referred to as Web Controls. Web Controls (also referred to as Server Controls), which are discussed in detail in Chapter 5, are compiled classes that run on the server and provide functionality similar to that of Windows controls such as textboxes, dropdown lists, etc. The key is that these controls run at the server, and so can be manipulated programmatically in server-side code.

    WebForm is a term used to describe an .aspxfile that makes use of Web Controls.

    Besides the containing directory and ASP.NET file(s), an ASP.NET Web Application may also contain configuration files ( web.config ), User Control files ( .ascx ), and an application settings file ( Global.asax ), as well as code-behind, assembly, and class files that provide additional functionality to the application. We’ll discuss each of these file types later in this chapter.

    This chapter is from ASP.NET in a Nutshell,  by G. Andrew Duthie. (O'Reilly, 2003, ISBN:  0596005202). Check it out at your favorite bookstore today. Buy this book now.

    ASP.NET ARTICLES

    - 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
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...
    - Order-Related Modules for an ASP.NET AJAX Se...
    - User and Role Management for an ASP.NET AJAX...
    - Programming an ASP.NET AJAX Server-Centric B...

    IBM developerWorks




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway