If you have access to the hosting control panel, it is best to set up your hosting environment with a virtual folder for your second website and start it from a subfolder, for example. www.example.com/ Project b . The first site can still work in the root folder, for example. www.example.com.
Thus, both sites will be essentially isolated from each other (just as they are now isolated as two separate projects in Visual Web Developer Express). And both sites have their own App_Code folder (and web.config file).
If you do not have access to the configuration panel, most hosting providers are ready to add a virtual folder to you, since this is really not a special requirement.
The virtual folder should appear as a regular folder in your FTP folder, usually in the www or wwwroot folder. Now you can copy the project files to this folder.
Observe the root paths for the URLs in the second project, so all links will work even if the website is launched from a subfolder. The root URLs are as follows:
<asp:HyperLink runat="server" NavigateUrl="~/Default.aspx" /> <asp:Image runat="server" NavigateUrl="~/images/logo.png" />
When you deploy a website in a virtual folder, they will automatically go to www.example.com/project-b/Default.aspx and www.example.com/project-b/images/logo.png .
If you need to reuse code from one site to another, it is usually best to move such code to a separate type of class library project, and then add a link to this project to each website project (right-click the website, select Add link ... ", then select the" Projects "tab and select the" Class Library "project).
source share