Unlike ASP, Asp.net can place a program in a folder without interfering with each other. In order to enable a virtual host to store multiple Asp.net files, no answer is perfect, however, some materials have inspired me. Through thinking and practice, I have finally explored a new way to achieve a simple solution that can be proposed as a website or merged. At the same time, I would like to thank you for your help. Please refer to the implementation results:
My personal website: http://www.socan.com.cn/
Customer Management System: http://www.socan.com.cn/crm
First of all, I would like to mention the requirements for placing the website on the same Virtual Host:
1. File merging in the bin folder ensures that all websites can call the classes they need.
2. Topics under app_theme can be merged and will not affect each other.
3. The link in the file must be a relative path.
4. Pay attention to the inheritance relationship in Web. config.
First, because I only have one database, the table names are prefixed, just like. the tables in the. NET member qualifications have the same prefix as the ASPnet, and all websites are placed under the same solution. This is like a three-tier structure that is the union of various websites.
Second, themes in app_theme use different names on each website. If a website has multiple themes, you can use the prefix method, in this way, topics can be merged without errors.
Third, of course, we need to reconstruct the existing website, and change all links to relative paths. Note that CSS is relative to the current file, while JS is relative to the files used, the file to be used by the client control. The server control is relative to the current file. It is recommended that you do not use IIS for debugging during development, which reduces the chance of directly using the relative root directory path due to customary issues.
Fourth, the root directory must have web. config. do not conflict with the sub-directory. Remember to add the web in the sub-directory after the sub-directory is generated. remove the authentication, profile, membership, and rolemanager nodes of config.
With this method, as long as you pay attention to the above points during development, the space can be used rationally.