localhost not opening website - asp.net

I created a blank Web App in ASP.NET on Visual Studio 2012.
When I click on Debugging using Google Chrome, Google chrome opens with text localhost on the navigation bar, but it does not open the website and keeps loading.

Go to project properties page and create a virtual directory. Make sure your starting page is pointing to this. Then navigate to http://localhost/myapp

One thing you can check is the following (running on a windows system):
Edit "C:\Windows\System32\drivers\etc\hosts", and ensure that you have this line: "127.0.0.1 localhost"
In my case, I had "0.0.0.0 localhost" in there.
I hope this can help.

Related

Visual Studio Opens Blank Browser Page

I got a new laptop for work and installed visual studio 2017 Professional version 15.9.39
But when I try to debug any of our web projects it just opens a blank webpage. If I enter "localhost://XXXXX" where XXXXX is my portnumber then it opens the webpage and I can continue to debug.
I have tried various different browsers and they all work the same way - blank web page but I can enter url and then it seems to connect.
I have also installed VS2019 professional and that works the same way. Why is it not opening to the localhost url with specified port?
Based on the comment, the solution is that changing the start option to "current page".

Webmatrix - upgraded, now cannot browse localhost sites

I am in the process of developing an ASP.NET site. Yesterday it was working fine. I then upgraded WebMatrix as I keep getting pop ups.
Now, when I try to browse to my site all I am getting is the website text, no CSS, no functionality just plain html text.
No links are working but when I try to enter something into the search bar and hit enter I get the following:
Firefox doesn't know how to open this address, because the protocol
(localhost) isn't associated with any program.
You might need to install other software to open this address.
Now I investigated this and found a this topic:
IIS, IE does not recognize web page protocal
And yes when I added the http and copied the address into IE it brought up the correct page. However then when I tried to navigate around I got the same problem in IE with the message:
No apps are installed to open this type of file (localhost)
I'm totally baffled so any advice would be really appreciated.

visual studio 2005 web page is not displayed after run

Page is not shown in the browser
I am using VS2005. I am working on Web Project. But my problem is whenever I am running my page ..the URL .I am getting is this http: //localhost:23644/UI/LoginUI.aspx
but the page I am getting is "Internet Explorer cannot display the webpage" For other web application its giving the same browser message ..though the URL is changing to the specific URL.
Can anyone help me in this issue? Thanks in advance
Can you please check if the localhost server (IIS) is started? For Visual Studio though,the IDE starts the server by itself, but you can always cross-check if the server is started via services.msc. Check also if the port 23644 is free.

setting default page in asp.net app

We have a asp.net app, in which index.aspx is the default document in the website, instead of default.aspx.
Index.aspx is set as start page in the project too. but when I am trying to open for example: http://localhost:2265/, 1st I was getting the default.aspx page, after I removed the default.aspx file from the solution, now I have the directory listing displayed.
I would like to get index.aspx when I am entering http://localhost:2265/, is that possible to be set in the project or only in IIS?
Thanks in advance and happy holidays, Laziale
This is controlled from the server, which could either be IIS or the development server that's bundled with Visual Studio.
If you're launching the app from within Visual Studio, then the controls can probably be found under the properties of the ASP web site/app that you're launching. You could also right click the page itself and select "Set As Startup Page".
All of this doesn't affect the behaviour of the app once it's hosted in IIS, however. You'll need to find similar settings in the IIS page - there should be many a tutorial on the web for that (I can point you to one if you're having trouble).
Hope this clears up the behaviour of default pages!
Just open your solution in VS, then select the page you would like to be the startup page and do a right click and select 'Set As Start Page' option
In your project right click on the page you want to be your landing page and click "Set as Start Page".
This will only work when you run it from Visual Studio though. If you want to do it once it's deployed you will have to use IIS or setup a redirect I believe.

Can't find the 'open in browser' option when r-clicking on default.aspx

Something strange is going on for me.
I can open the web application on my desktop computer just fine, where it opens the asp.net MVC application with a URL like http://localhost:5118/ when I rigth click on the default.aspx file and choose 'open in browser'.
On my laptop, I don't have that option when I right click on default.aspx for some reason (it should give me the option to Open in Browser). I set the project as a web application, but it still doesn't work.
This is a vs.net MVC application.
I want to open the application without having to setup a IIS site for it.
You don't have what option on your laptop? Can you be a bit more clear?
Also, make sure your hosts file has:
127.0.0.1 localhost
-- this is advice from another site --
Can you see it under the File option while current page is aspx page? Shortcut key of "View in Browser" is Ctrl+Shift+W.
You can try to run "devenv /resetsettings" from Visual Studio command to reset settings.
You also can try to run "devenv /resetuserdata" to reset Visual Studio to its out-of-box state.

Resources