VS Web Server relative hyperlink problem

C

chambersdon

I have 2 projects, in the same Visual Studio solution, with hyperlinks
between them. These are file system projects that use the Visual
Studio Web Server, not my local IIS. When the Visual Studio Web
Server starts the projects are running on a port, and each project has
a different port.
For example, website1 runs on http://localhost:1234/webSite1
And website2 runs on http://localhost:5678/webSite2

Because of the port I cannot link between the two projects. In
webSite1 I want a relative hyperlink that links to webSite2 (href="/
webSite2/somePage.aspx"). How can I accomplish this?

These are existing projects that were built using IIS. Due to
security concerns we are no longer able to run IIS on our development
machines and must use the Web Server that comes with Visual Studio.
I'm trying to make this work with changing code or our design. Is
that possible?

Thanks for any help,
Don
 
S

Stevanich

Don,

What you might try doing is setting the port to be static in the web
projects, and using the configuration file to specify the other site's
address. Then you can pull the base address from the configuration file to
build your URLs between the sites.

To set the port to be static, left-click on the web project. In the
Properties property grid, set "Use dynamic ports" to false, and set a value
for "Port number".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top