Getting Started with ASP-the first ASP. NET application (2)

Source: Internet
Author: User

Add a Web Form

The contents of this section:

    • What is a Web Form
    • How to add a Web Form

1. Add a Web form to the project

Web Forms are an ASP. NET feature that you can use to create a user interface for your WEB application. Web Forms pages provide you with a powerful and straightforward programming model that uses your familiar rapid application development (RAD) technology to generate a complex WEB-based user interface.

For beginners, it's enough to know that adding new Web Form items to add content to a Web application is all that's needed.

On the Project "Partyinvites" (note not the Partyinvites solution), right-click, select Add-new item, pop up the Add New Item dialog box:

Figure 1 Adding a new item

Click the Add button to exit the dialog box and create a new item. You will see that Visual studio has added the Default.aspx file to the project in the Solution Explorer (Solution Explorer) and opened the file for editing. The initial contents of the file are shown in Listing 1-1.

Code Listing 1-1 The initial contents of the Default.aspx file

Essentially, a Web Forms file is an enhanced HTML file. The elements with <% and%> tags indicate that this is not a regular HTML file, the runat attribute in the head and form elements [this book translates the property into "attributes" and attribute to "features". This is also illustrated by the translator's note. This is covered later, and now just to emphasize that the form file is really HTML. In code listing 1-2, we have added some standard HTML elements to the Default.aspx file.

Code Listing 1-2 Adding standard HTML elements to the Default.aspx file

Here you add a h1 element and a P element, which contains some simple text. These are not special elements that are specifically for ASP. NET, but standard HTML elements.

Getting Started with ASP-the first ASP. NET application (2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.