Search code examples
asp.netvirtual-directory

Access one web project file to another web project


Problem

Hi I'm working on asp.net web form projects and I have two web projects in one solution, the first one is website section and the second one is admin section.

I have created one folder that is siteadmin inside of website project and I put the project file(.csproj) of admin section inside of siteadmin folder. Now I want to access siteadmin files from main website.

For example please look below :

http://localhost:1426/siteadmin/default.aspx

Where default.aspx is a file of admin web project.

Please help me out.


Solution

  • This is just a matter of deploying the admin app into a subfolder in the main app. Nothing to do with where you put the .csproj file.

    For development, just use local IIS for both apps and set the virtual directory URLs to be something like this:

    Main website: http://localhost/website

    Admin website: http://localhost/website/admin

    Refer to this: How to: Create IIS Virtual Directories in Visual Studio

    Likewise, when you are ready to publish to a server, the admin app files just need to be within a subfolder of the main app.

    For example:

    Main website files: C:\inetpub\website\

    Admin website files: C:\inetpub\website\admin\

    Set up the physical paths for the two apps accordingly in IIS.