Asp.net domain name Development

Source: Internet
Author: User
Tags net domain

Today, the great water is fierce, and the two giants are recreating the rivers and lakes. The home page starts to take effect instantly. On this business trip, the grass and grass are coming, and the content is under the tide.

 

If you think this article is helpful to you, I would like to recommend it with enthusiasm.

 

I. development using IIS provided by VS IDE

Summary: In VS2005, we often develop IIS Based on IDE. there are usually two development methods.

1: WebSite:

If we build an early webSite, we always have a directory address after running it,

 

 

2: WebApplication:

If vs2005 is patched with sp1 or in vs2008/vs2010, a new webApplication can be created. After running it, there is no more directory,

 

 

Problem:

If a WebSite is created, it is inconvenient to develop because there is an extra directory structure. There are many problems ~!

 

Here is a small example to illustrate the problem:

We also add A link for the above method:

// WebSite html
Method: <a href = "/Default. aspx"> WebSite </a>

// WebApplication html
Method: <a href = "/Default. aspx"> Application </a>

Note:

As we all know, "/" represents the root directory. It should be okay to write such html. However, this problem is wrong in the WebSite mode.

 

Click the link. The error message is as follows:

 

How can this problem be solved?

If you intentionally want to handle this root directory problem in the code, it is quite troublesome to handle it.
However, WebApplication is normal. Therefore, currently, most developers have created WebApplication projects.
So how can we solve the problem of multiple directories such as WebSite today? It is developed using the system's IIS.

 

2. Use the system's IIS for development

To develop system IIS, we need to make the following settings

1: Set the custom server to your own lan ip address, and set it to 127.0.0.1.

For WebSite project properties

 

 

Project Properties of WebApplication

 

 

Note: After locating the Development Directory in IIS, remember to click "create virtual directory" before using it.

 

 

2: The corresponding IIS website directory needs to be located in the Development Directory

Locate the directory to the development website directory

 

 

 

Set to IP Address Access

 

 

Set results

After the configuration is complete, when we browse the original WebSite or WebApplication site, it is the form of IP address access.
At this time, you can use the previous click link to avoid errors, and there is no more directory,

 

 

End statement:

So far, by using the system IIS for development, we can avoid an extra layer of directory, and we also switched to IP development.
In the implementation project, many times, we may need to check the root website domain name, and the website domain name is often related to cookies.
Therefore, the next step is to focus on developing with Domain Name spoofing.

 

 

Iii. Domain Name spoofing Development

1: domain name spoofing settings

Open the following path: C: \ WINDOWS \ system32 \ drivers \ etc. A host file is displayed,

 

Open it in notepad and output a line: 127.0.0.1 www.abc.com/
If you enter www.abc.com/in your browser, Set

 

 

2: Set Project Properties

Change the project property IP address to a domain name.

 

WebSite attributes,

 

 

 

View results: You can use a domain name to cheat access,

 

 

 

WebApplication property settings

 

For this setting, if you click create virtual directory directly, there may be more problems, such:

 

 

Note: This attribute is caused by host pointing to 127.0.0.1, and IIS uses 192.168.3.48 as long as it is changed to the same type.

 

The following shows how to create a virtual directory: I added another domain name to point

192.168.3.48 http://www.cyq.com/

 

In order for F5 to run, not just right-click the tour mode, you need to make the following settings

A: iis host Header settings

 

B: create a virtual directory.

 

Run F5.

 

Pay attention to the following issues during Configuration::

1: IP address pointed to by the host file Domain Name
2: IP Address used for setting IIS website Properties
3: domain names must be added to the Host header of the IIS website.

If a debug running error occurs:Debugging cannot be started on the Web server. An authentication error occurs when you communicate with the Web server.

If the problem persists, follow these steps:

Disable loop check
1. Open the Registry Editor and find the item HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Lsa.
2. Right-click Lsa, create, DWORD Value item: DisableLoopbackCheck, and change the value to 1.

 

 

Conclusion:

With this domain name development method, you can imitate the same development method as after the website is published, and do not have to worry about the path and domain name final problems.
For many subdomain names, the method is the same, but the host file body is changed:
192.168.3.48 a.cyq.com

 

 

 

 

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.