views:

125

answers:

4

I have a solution with two websites (folder based) and two class libraries. I need to be able to dynamically set a path from one of the websites to the other. More specifically, I am setting the PostBackUrl property of an image button that is in a datagrid row. Building and setting the URL for the production environment is easy. But in the development environment - where each project runs on a different port - it is a bit more confusing.

Is there a way to do this?

+1  A: 

You could setup up VS to use IIS for debugging - that way it would be the same as your production environment.

chris
Agreed... that's the simplest solution.
Cerebrus
+2  A: 

Another approach would be to store the base urls in the web.config file and change based on the environment they'll be running under.

Brian
Web.Config or App.Settings would be good for this
Rob Allen
A: 

You could use IIS for setting up your web site or assign a fixed port by setting "Use Dynamic Ports" to false under web site properties.

Gulzar
A: 

Hi All! I have the similar set up as Jim. I am currently developing two websites that are in the same solution in VS 2008. When I'm trying to redirect from one website to another I get 404 error. Both sites have IIS (5.1) virtual directory set up. Could you recommend me the solution please?

Olga