yahya kh
yahya kh

Reputation: 751

Localhost:PortNumber issue?

I have a website which i wanted to ran on locally, i ran it fine with no problems but since the website was downloaded from the host i had to change all the inner links which points online to local ones. I tried many things at first but nothing actually works until i used the following:

http:\localhost:portnumber\website........

Now when i created a new folder and put the website in it and ran it again the port number changed thus all the links i have put inside is not working anymore and needed to change the port number again. Is there any solution for this problem instead of writing the localhost:portnumber and why does the port number changes each time its in a new folder ?

Upvotes: 0

Views: 639

Answers (1)

Chamika Sandamal
Chamika Sandamal

Reputation: 24332

you can use relative paths for the links. if you really want to use specific port for the application try following steps,

To specify a port for the ASP.NET Development Server - WebSite / WebServices projects

  1. In Solution Explorer, click the name of the application.
  2. In the Properties pane, click the down-arrow beside Use dynamic ports and select False from the dropdown list.This will enable editing of the Port number property.
  3. In the Properties pane, click the text box beside Port number and type in a port number.
  4. Click outside of the Properties pane. This saves the property settings.

To specify a port for the ASP.NET Development Server - Web Application project

  1. Right click the Project in the Solution Explorer, and then select “Properties”
  2. Click “Web” tab.
  3. Check “Specific port” instead of “Auto-assign Port”.

Upvotes: 2

Related Questions