bitwix

Tangential comments about Software Development

Tuesday, October 16, 2007

ASP.Net and Subsites

By Subsite I mean www.yourdomain.com/newarea. In my case I wanted to add www.rentroll.co.uk/gwlflickrtagr to help Guess Where London users on Flickr tag their photos. The project had to be completely independent of the code for www.rentroll.co.uk.

There are probably better ways of doing these things. But each workaround is helping me.

Don't use web.config as IIS throws a wobbly if you have the file in a sub-directory

Don't use app_code as the compiled bin classes go in www.rentroll.co.uk/bin and the app_code there is for the main site

Make your own Page parent class requires using statements in all .aspx.cs code but that's a small price to pay for the code sharing

./MasterPage.master instead of tilde-slash. Tilde slash will look in the parent directory.

this.Page.Request.PhysicalPath tells you where your application is installed. This gets away from needing lots of Directory entries in the web.config you're not allowed to have.