[Top] The first ASP. NET Website-from static to dynamic

Source: Internet
Author: User

Procedure]

1. Create a simple static webpage

1InDDisk creation folderAAA;

2, In the folderAaaIn this document, enter the following content:

 
<HTML>  

 

3, Save or modify the file nameFirst.htmlNote: To modify the name of a text file, to display the extensions of known file types in the resource manager, set tools> Folder Options> View> remove the "Hide extensions of known file types" selected by default "), this makes it easy to make sure that the extension is modified.

2. Enable and configureIIS

1, Start → Control Panel →Program→ Programs and functions → turn on or OFFWindowsFunction → selectedInternetInformation Service, showing:

2, ExpandInternetInformation Service, select". NetScalabilityASP. NET","ISAPIExtensionISAPIFilter and server include ",:

3, → Control Panel → system and security → management tools → double-click"InternetInformation Service (IIS) Manager ", open"InternetInformation Service (IIS) Manager ", showing:

You can also run inetmgr directly..

3. Right-click the default website (default wet site)→ Add a virtual directory. In the "add virtual directory" dialog box, set the alias BBB and the physical path to D: \ AAA ,:

3. Browse static Web pages

Open your browser and enter the following URL to browse the webpage:

Http://win7u-20130427r/BBB/first.html

Http: // localhost/BBB/first.html

Http: // 127.0.0.1/BBB/first.html

Http: // 192.168.1.100/BBB/first.html

The "win7u-20130427r" and "192.168.1.100" are the machine name and IP address, the experiment machine is different, there will be different.

4. Simple Dynamic Website

1. Use notepad to create the first. aspx and first. aspx. CS files in the folder AAA. The content is as follows:

First. aspx:

<% @ Page Language = "C #" autoeventwireup = "true" codefile = "first. aspx. CS "inherits =" first "%> <HTML>  

First. aspx. CS:

 
Using system; public partial class first: system. web. UI. page {protected void page_load (Object sender, eventargs e) {response. write ("Hello, now"); response. write (datetime. now. tostring ());}}

 

5. Browse dynamic web pages

Open your browser and enter the following URL to browse the webpage:

Http: // 192.168.1.100/BBB/first. aspx

 

[Technical description]

1. In terms of the structure and content of a dynamic website, there is a backend that runs on the server more than a static website.CodeIn ASP. NET, this background code is usually written in C.

2. It does not mean that the content of a webpage can be active or changed. It is called a dynamic website. The essence of a dynamic website is that the webpage content is dynamically generated by the background code running on the server. Using a .swf file or GIF file will make the content of the webpage dynamic, but these are still static website content. Using javascript can also implement the above functions, but JavaScript runs on the browser side, therefore, it cannot be called a dynamic website.

3. We use only notepad for the above website, because these files are all text files. Generally, static websites use Dreamweaver to facilitate editing and debugging. ASP.. NET Dynamic websites generally use Visual Studio 2008 or Visual Studio 2010. It not only facilitates editing and debugging static website content, but also facilitates editing and debugging background C # programs.

 

 

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.