ASP.NET
  Home arrow ASP.NET arrow Page 3 - ASP.NET and the .NET Framework
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 and the .NET Framework
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 38
    2005-03-16

    Table of Contents:
  • ASP.NET and the .NET Framework
  • ASP.NET
  • Visual Studio .NET
  • The ASP Version
  • Hello World Using Visual Studio .NET
  • Add two more HTML labels

  • 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 and the .NET Framework - Visual Studio .NET


    (Page 3 of 6 )

    Since all the ASP.NET source files are plain text, you can develop all your web applications using your favorite text editor. In fact, many of the examples in this book are presented just that way. However, Visual Studio .NET, the integrated development environment released in conjunction with the .NET Framework, offers many advantages and productivity gains. These include:

    • Visual development of web pages
    • Drag-and-drop web form design 

    • IntelliSense and automatic code completion

    • Integrated debugging

    • Automated build and compile

    • Integration with the Visual SourceSafe source control program

    • Fully-integrated, dynamic help


    Chapter 2 discusses Visual Studio .NET fully.

    Hello World

    It is a long-standing tradition among programmers to begin the study of a new language by writing a program that prints “Hello World” to the screen. In deference to tradition, our first web page will do just that.

    The tool you are most likely to use when developing ASP.NET applications is an integrated development environment (IDE), such as Visual Studio .NET. However, you may use any editor you like—even the venerable text editor Notepad.

    There are a number of advantages to using an IDE such as Visual Studio .NET. The Visual Studio .NET editor provides indentation and color coding of your source code, the IntelliSense feature helps you choose the right commands and attributes, and the integrated debugger helps you find and fix errors in your code.

    The disadvantage of using an IDE, however, is that it may do so much work for you that you don’t get a good feel for what is going on in your application. It is like bringing your car in to the mechanic. He does all the work for you, but you never really learn how your engine works.

    As a beginner, you may be better off doing more of the work yourself, giving up the support of the IDE in exchange for the opportunity to see how things really work. In this chapter, you will use a simple text editor to create the source code for the first several iterations. At the end of the chapter, you will use Visual Studio .NET to create the same web page. (For the remainder of the book, you will find both examples that are created using a text editor and examples that are developed in Visual Studio .NET.)

    Back in the old days, before ASP and ASP.NET, web pages were created with simple HTML. To better appreciate the features of ASP.NET, you will first create the Hello World web page in HTML, then convert it to ASP, and finally convert it to ASP.NET.

    The HTML Version

    Straight HTML provides a means of creating and presenting static web pages. This book is not a tutorial on how to write HTML,and we assume you know enough HTML to follow the simple examples provided. For background reading,see HTML: The Definitive Guide,by Chuck Musciano and Bill Kennedy (O’Reilly). To get


    A Word About the Samples in This Book

    In real life, web sites run from a web server, which is typically a separate machine (or machines) running a web server program, such as Microsoft Internet Information Server (IIS). In that case, a browser makes a request to the server, which processes the request and sends HTML back to the browser.

    If you have a web server available, you could certainly put the samples from this book on the server and run them that way. Suppose the server domain name is MyServer.com and the web page you want to test is HelloWorld.htm, which is located in the virtual root directory of the web server. The URL to be entered in your browser would be:

      www.MyServer.com/HellowWorld.htm

    It’s easier to do your development and testing on a single machine, then deploy to a web server for final testing and production. You must have IIS set up on your local machine.

    IIS (the name has evolved to Internet Information Services) is included with Windows 2000 Professional and Windows XP Professional. It is not installed by default, although it can be installed if a custom Win2K/WinXP installation is performed. It can also be installed at any time by going to Control Panel, selecting Add/Remove Programs, and clicking on the Add/Remove Windows Components button.

    To access the virtual root of a local copy of IIS, the URL should refer to localhost. By default, localhost points to the physical directory c:\inetpub\wwwroot.

    Typically, you will define other virtual directories using Internet Services Manager (found in Control Panel Administrative Tools). These virtual directories can be subdirectories anywhere on the local machine. If you have a directory defined on your C drive named c:\myProjects, you can define a virtual directory named projects that you “point” to that directory. If your HelloWorld.htm file is located in c:\myProjects,then the URL to enter in your browser would be:

      localhost/projects/HelloWorld.htm

    For now, you will create a subdirectory called c:\projects\Programming ASP.NET. Then you will use Internet Services Manager to define a virtual directory, called ProgAspNet, pointing to that location. If the HTML file you want to run, HelloWorld.htm, is in that directory, then the URL to enter in your browser will be:

      localhost/ProgAspNet/HelloWorld.htm


    started, create a very simple Hello World HTML file, as shown in Example 1-1, and call it HelloWorld1.htm. The output is shown in Figure 1-2. 

    Example 1-1. Code listing for HelloWorld1.htm


    <htm1>
       <body>
          <h1>Hello World</h1>
       </body>
    </htm1>
     


    Figure 1-2.  Output from Example 1-1

    The HTML page displays the static text, using the HTML heading1 format. If you want to include dynamic content, such as the results of a query against a database or even the current time, then a static HTML page is not the thing to use. For that you need some sort of server processing. There are a number of alternatives; we will focus on ASP and then on ASP.NET.

    More ASP.NET Articles
    More By O'Reilly Media


       · Good Article for beginnerHi This good article for asp.net beginner The .NET...
     

    Buy this book now. This article is excerpted from Programming ASP.NET by Jesse Liberty and Dan Hurwitz (O'Reilly, 2003; ISBN 0596004877). Check it out at your favorite bookstore today. Buy this book now.

    ASP.NET ARTICLES

    - 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
    - Building a Simple Storefront with LINQ

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




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