Understanding the Web Forms Designer

Although an ASP.NET application can be created using the most basic of editorsNotepad, for exampleit is often much easier to create a sample application using one of the wizards provided with Visual Studio .NET. When a wizard is invoked, Visual Studio .NET creates all the code, HTML, and C# code necessary to implement an empty framework behind an ASP.NET application. Even though this will be an application that compiles, it will not be very useful unless you add some sort of visual components or make the application do something in addition to appearing in the web browser.

To make the task of adding components to the Web Form easier, Visual Studio .NET provides the two different views of a form shown in Figure 21.1: the Design view and the HTML view.

Figure 21.1. Design view of the Web Forms Designer.

Adding components to the form can be done in a few different ways. The Design view enables you to add components to a form by simply dragging and dropping them from the toolbox to the form. Visual Studio .NET will then add all the necessary HTML code to the form. If you are an HTML expert and prefer to manually type the code, or if you want to see what the Designer generated, click the HTML tab and you will see the code that was generated, as shown in Figure 21.2.

Figure 21.2. HTML view of the Web Form Designer.

Now that you have a basic understanding of the Web Forms Designer, it is time to create your first ASP.NET application. In the next section, you will learn how to create a Hello World application by using the ASP.NET Application Wizard.

    Visual C#. NET 2003 Unleashed
    Visual C#. NET 2003 Unleashed
    ISBN: 672326760
    EAN: N/A
    Year: 2003
    Pages: 316

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net