ASP.NET
  Home arrow ASP.NET arrow Page 5 - 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 - Hello World Using Visual Studio .NET


    (Page 5 of 6 )

    Visual Studio .NET is a full-featured IDE that provides all sorts of productivity tools for developing .NET applications, both for the Windows desktop and for the Web. These features include:

    • A Start page, which allows you to set user preferences for IDE behavior and provides easy access to new and existing projects.

    • Dynamic, context-sensitive help, which allows you to view topics and samples relevant to your current selection. You can also search the MSDN library from within the IDE.

    • IntelliSense technology and code completion, which allow you to enter code with fewer errors and much less typing. Syntax errors are flagged immediately, allowing you to fix problems as they are entered.

    • The tabbed document interface, which provides convenient access to multiple design and code windows.

    • All the languages use the same code editor for a shortened learning curve. Each language can have specialized features, but all benefit from features such as incremental search, code outlining, collapsing text,line numbering, and color-coded keywords.

    • The HTML editor,which provides both Design and HTML views that update each other in real time.

    • The Solution Explorer, which displays all the files comprising your solution (which is a collection of projects) in a hierarchical, visual manner.

    • The integrated Debugger, which allows you to set breakpoints and step through code, even across multiple languages.

    All of these features, and more, will be covered in subsequent chapters. For now, you will use the IDE to create a simple Hello World web page.

    Open Visual Studio .NET. You should see a window similar to Figure 1-5.


    Figure 1-5.  Start page in Visual Studio .NET

    Click on the New Project button in the middle of the screen. This brings up the New Project dialog box shown in Figure 1-6.

    The left side of this dialog box allows you to choose the type of project. In Figure 1-6,Visual C# Projects is selected. You could click on Visual C# Projects or Visual C++ Projects if you would rather work in either of those languages. The example will be shown in C# and VB.NET; as you will see, it is virtually identical in both languages.

    The right side of the dialog box lists the various project templates to choose from. Select ASP.NET Web Application.

    The Name and Location edit fields will contain default values. Change the Name, by editing the Location field, from WebApplication1 to HelloWorld. As you do so, you will see the label below the Location edit field change to:

      Project will be created at HTTP://localhost/HelloWorld.


    Figure 1-6.  New Project dialog box in Visual Studio.NET

    By default, localhost corresponds to the physical directory c:\inetpub\wwwroot. This line tells you that it will create this new web application in the physical directory c:\ inetpub\wwwroot\HelloWorld. Click OK.

    Visual Studio .NET will now present a design surface in the middle of the screen. Before proceeding any further, change the pageLayout mode from GridLayout to FlowLayout. This will make the resulting HTML simpler and more in line with our previous examples. To do so, click anywhere on the design surface. The Properties Window, visible in the lower right of the screen, should be visible with the word DOCUMENT showing in the edit field at the top of the Properties Window. If the Properties Window is not visible, choose Properties Window from the View menu, or press F4.

    In the Properties Window, slide down until the pageLayout property is visible. Click on the displayed value, GridLayout. A drop-down arrow will appear. Click on it and select FlowLayout. Immediately, the design surface changes appearance. The results will look something like Figure 1-7.

    Now you want to add some labels. Notice that the Toolbox on the left edge of the screen currently displays Web Forms controls. You will use those in a moment. For now, you want to place some HTML controls, so click on the HTML button near the bottom of the Toolbox.

    Click on the Label control and drag it to the design surface. It will automatically go to the upper-left corner of the design surface and contain the word Label. Click on


    Figure 1-7.  Setting FlowLayout in Visual Studio .NET

    the control, backspace over the word Label,and type the words Hello World. It will look something like Figure 1-8.

    Notice the drop-down lists in the toolbar just above the design surface, one of which displays the word Normal. These are part of the Formatting menu. If they are not visible, choose Toolbars from the View menu and click on Formatting.

    The drop-down containing the word Normal displays the available block formats. Click on the down arrow and select Heading 1. Then click and drag on the resizing handles to stretch the control so that the phrase does not wrap. The screen should look something like Figure 1-9.

    If you want to see or edit the HTML directly, click on the HTML tab at the bottom of the design surface. The Design and HTML tabs allow you to toggle between graphical design and code-editing modes.

    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