IIS doesn't show my web page - asp.net

I had some problems to show my webPage using IIS 8.0.
Now I get no erros when I open my page through IIS but now it only appears:
Local host - /
Date Time Folder's Name
Date Time Folder's Name
Date Time Folder's Name
What Should I do to show my WebPage?
I already checked the ASP.NET option on Active or Desactive Windows Featuresof control panel.

If you want to use a custom page name for your default page like "mypages.aspx" as in your case, you can configure to do so in your web.config
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="~/mypages.aspx"/>
</files>
</defaultDocument>
</system.webServer>
You can do the same in IIS going to DefaultDocument section under your deployed site settings in IIS. Check this and this so question as your are using IIS8 for more info.

Did you check to make sure you have a default webpage? E.g. index.html, index.asp, default.html or default.asp? The names are based on the settings of the site of course.
Make a basic html page:
<html>
<body>
Hello world.
</body>
</html>
Then put it in the directory IIS is looking for, for the website. You'll want to make sure you setup your DNS to reflect the domain you are trying to host, and then change your local network settings to use your computer's IP before any other DNS. This will allow you to see the website.

Related

Correct path to publish to IIS

I've managed to deploy my website to test through Publish Web in VS2012 using the connection criteria below. This launches fine and works as expected but I need to keep clicking the publish button each time to get the page to launch.
However, rather than keep publishing each time, I'm trying to run it directly from IIS by opening IIS (inetmgr) select the site folder and browse. However, it tries to launch localhost/MyWebsite/ and not the full path localhost/MyWebsite/home.aspx so I get a blank page.
The project also has the home.aspx set as start page. Can anyone point out why I can't get this to run from IIS where it's already published? It's probably something obvious but I can't see it.
ON IIS, go to DEFAULT and add HOME.aspx, on the top of the list.
In IIS, you specifying that you want to browse that site which is "localhost/MyWebSite/" you could go into "Content View" and select "Home.aspx" and then select browse if you want the full path to that file for another solution.
Insted of setting default document from IIS set it from web.config . so that you no need to set default document every time .
Web.config
<configuration>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="home.html" />
</files>
</defaultDocument>

start Page functionality does not work

I have an asp.net website,
and i have set 1 page "search.aspx" as start page,
and when i type url like this:" http://localhost/websitename/subfolder/Search.aspx"
it opens properly.
but i want it to open when i type : " http://localhost/websitename/" like this only,
and i have set the "search.aspx" as start page.
Can anyone please help,
i tried changing property pages also.
but it did not help.
Start Page in Visual Studio just refers to the page which will be opened when you Run your solution.
When running localhost, the "Default Page" for ASP.NET is always Default.aspx (unless you do a lot of workarounds).
In IIS you have control over this however, by setting "Default Documents".
You need to set the start page in IIS. Here is a tutorial
http://www.ehow.com/how_4532283_set-start-page-microsoft-iis.html
There are two points to consider here.
Firstly, you need to look in IIS and see what "Default Documents" you have set up for that web application. If "search.aspx" is not listed then that page won't be served as a default page for that folder. If you add "search.aspx" as a default document then your page will show if you navigate to websitename/subfolder/
Secondly, are you providing a way to traverse to the subfolder? IIS will be looking for the default document in the ..websitename/ folder. If the default document was "default.aspx" you need to add some sort of redirect to the subfolder.
Alternatively, set the subfolder as the root folder of your website (unless you need to go up one level).
You have to specify a default document for the page in IIS, or make the default page redirect to the search page, alternatively use routing.
Here is how you set default document in IIS6.
Since you want a page in a subfolder to be the default your easiest path is either a redirect or routing.
you can try doing this.
take a blank index.htm page and add meta tag for redirecting to your starting page:
<head>
<title></title>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://localhost/websitename/subfolder/Search.aspx">
</head>
Make default page(index.htm) in IIS for the website.
IIS7
IIS 6.0
use following setting in web.config:
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="index.htm" />
</files>
</defaultDocument>
</system.webServer>
reference:Default Document

How do I set the default page of my application in IIS7?

I deployed my web application to IIS7 and everything works just fine. However, instead of typing the url of my true starting page, I want it to automatically go to www.xxxxxx.com/views/root/default.aspx.
How do I do this?
Just go to web.config file and add following
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="Path of your Page" />
</files>
</defaultDocument>
</system.webServer>
On IIS Manager select your page in the Sites tree.
Double click on configuration editor.
Select system.webServer/defaultDocument in the drop-down.
Change the "default.aspx" to the name of your document.
Karan has posted the answer but that didn't work for me. So, I am posting what worked for me. If that didn't work then user can try this
<configuration>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="myFile.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
On IIS Manager--> Http view--> double click on Default and write the name of your desired startup page, Thats it
For those who are newbie like me, Open IIS, expand your server name, choose sites, click on your website. On new install, it is Default web site. Click it. On the right side you have Default document option. Double click it. You will see default.htm, default.asp, index.htm etc.. to the extreme right click add. Enter the full name of your file(including extension) that you want to set it as default. click ok. Open cmd prompt as admin and reset iis. Remove all files from c:\inetpub\wwwroot folder like iisstart.html, index.html etc.
Note: This will automatically create web.config file in your c:\inetpub\wwwroot folder. I didnt have any web.config files in my inetpub or wwwroot folders. This automatically created one for me.
Next time when you enter http(s)://servername, it opens the default page you set.
If you want to do something like,User enter url "www.xxxxxx.com/views/root/" & default page is displayed then I guess you have to set the default/home/welcome page attribute in IIS. But if user just enters "www.xxxxxx.com" and you still want to forward to your url, then you have write a line of code in the default page to forward to your desired url. This default page should be in root directory of your application, so www.xxxxx.com will load www.xxxx.com/index.html which will redirect the user to your desired url
I was trying do the same of making a particular file my default page, instead of directory structure.
So in IIS server I had to go to Default Document, add the page that I want to make as default and at the same time, go to the Web.config file and update the defaultDocument header with "enabled=true". This worked for me. Hopefully it helps.

When publishing a web site, my default document name keeps getting removed from IIS

I have an ASP.NET web site project, which I'm publishing to IIS on my Win2k8 R2 server. It has a default page called login.aspx. I set that up on the published web site.
Trouble is, every time I publish a new version of the web site, the login.aspx entry gets erased from the "Default Document" settings of the web site in IIS. This is very annoying. How can I publish my web site from Visual Studio without wiping out the default page every time?
Try putting a defaultDocument in your site's web.config:
<system.webServer>
<!-- your other stuff -->
<defaultDocument enabled="true">
<files>
<clear/>
<add value="login.aspx"/>
</files>
</defaultDocument>
</system.webServer>
You are probably using "sub site", and the default document list of the root website is blank.
Try adding default document (even dummy) to the root website and see if it helps.
(Taken from here: http://forums.iis.net/t/1169880.aspx)
when the login.aspx is added to subsite. it's type 'local'. it gives this error.
you should add this page to the servere itself.
click the server and then choose the feature view--> iis--- default document then right click to add your "login.aspx" page.
now you should see this in default document of all your sub sites and it will not be erased in publish or server restart.
this is my personal exceperience
Omar kamel

Extensionless Page Requests

I have a customer of ours that sent out a publication referring to my site but they used the wrong address...they did not provide a page name...it looks like this:
mywebsite.org/Resources/toolkits/bridging
when it should have been
mywebsite.org/Resources/toolkits/bridging/default.aspx
Is there a way to tell ASP.NET to default to this default.aspx when it sees this kind of request or even better, have IIS 7 handle this easily?
This site is live so I would like to avoid having to introduce code if possible.
As per other suggestions, this should be done in the IIS configuration for your website using the IIS Admin tool.
There is however, another alternative - you can add a section in the web.config of your actual ASP.NET application, allowing you to override the IIS configuration right from your application:
<system.webServer>
<defaultDocument>
<files>
<clear />
<!-- Specify each of your files by order of preference here -->
<add value="Default.aspx" />
<add value="Index.aspx" />
<add value="MyOtherPage.aspx" />
</files>
</defaultDocument>
</system.webServer>
The caveat to this though is it may be a little obtuse when the IIS administrator can't figure out why the server configuration isn't working the way he's got it configured. It's not always right to do something just because you can.
Finally, just in case you don't have access to the IIS server or your IIS administrator has reasons for not adding Default.aspx to the default document list in the IIS configuration and for whatever reason, you don't wish to override the IIS configuration in your web.config file, then the quickest and simplest way is to simply create a file called default.asp in that directory containing:
<% Response.Redirect("default.aspx") %>
Default.asp is in the default document list on IIS. The code will automatically redirect the call to the correct page. The downside to this approach though is that there's a performance hit - every time someone calls default.asp - directly or otherwise, the redirect needs to happen which isn't free.
In the Documents tab of the web site properties in IIS you can specify default documents. If you are using .Net2.0 or later on that machine then Default.aspx should already be set....
Default.aspx is not, oddly enough, set as the default document in an IIS installation; In IIS 7, the setting is under "HTTP Features", called "Default Document". Add default.aspx to that list and you should be OK.
If not, you'll need to add a 404 handler that redirects when it sees that URL.

Resources