. Net Getting Started Tutorial: ASP. NET webpage usage

Source: Internet
Author: User
Tags html page classic asp

A simple ASP. NET page looks like a common HTML page.

 

Hello W3Schools
When learning ASP. NET, we will build a very simple HTML page that will display "Hello W3Schools" in an Internet browser like this:

Hello, W3Schools!
 

 
 

 

Hello W3Schools in HTML
This code displays an HTML page, for example:

<Html>
<Body bgcolor = "yellow">
<Center>
<H2> Hello W3Schools! </H2>
</Center>
</Body>
</Html>
If you want to save your code in a file named "firstpage.htm" and create a link, the file is like firstpage.htm. Hello ASP. NET W3Schools is the simplest way to convert HTML web pages to ASP. NET page is a copy of the HTML file to a new file. To be extended. This code shows our example as an ASP. NET page: <Body bgcolor = "yellow">
<Center>
<H2> Hello W3Schools! </H2>
</Center>
</Body>
</Html> If you want to save your code in a file named "firstpage. and create a link to the File: firstpage. how does aspx work? Basically, an ASP. NET page is the same HTML page. HTML webpage extension. Media. If the browser requests a webpage from the server, the browser that the server sends the webpage is not modified. The extension of an ASP. NET page. If necessary. If the browser requests an ASP. NET page, any executable code webpage of the server process will be sent back to the browser in the result. The ASP. NET page does not contain any executable code, so it is not executed. In the following example, we will add some executable code web pages to prove the differences between static HTML web pages and dynamic ASP web pages. The Classic ASP Dynamic Server web page (ASP) has been around for several years. With ASP, executable code can also be placed in the HTML webpage. Previous versions of ASP (previous ASP. NET) is usually called the Classic ASP. ASP. NET is not fully compliant with the classic ASP, but the most classic ASP web page will be fined as a working ASP. NET web page, with only slight changes. If you want to learn more about the classic ASP, visit our ASP tutorial. In traditional ASP, dynamic pages show the dynamic content of web pages. We have added some executable code (red) in the previous example: <Body bgcolor = "yellow">
<Center>
<H2> Hello W3Schools! </H2>
<P> <% Response. Write (now () %> </p>
</Center>
</Body>
</Html> "%-%" in the code indicates the server on which the code is executed. Response. Write is the HTML output stream for ASP code writing. Now, () is a function that returns the current date and time of the server. If you want to save your code in a file named "dynpage. asp" and create a link, the file is like dynpage. asp dynamic page in ASP. NET: <Body bgcolor = "yellow">
<Center>
<H2> Hello W3Schools! </H2>
<P> <% Response. Write (now () %> </p>
</Center>
</Body>
</Html>

Related Article

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.