Reputation: 147
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.
Upvotes: 0
Views: 1029
Reputation: 7525
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.
use following setting in web.config:
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="index.htm" />
</files>
</defaultDocument>
</system.webServer>
reference:Default Document
Upvotes: 0
Reputation: 29811
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.
Upvotes: 0
Reputation: 1136
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).
Upvotes: 0
Reputation: 25465
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
Upvotes: 0
Reputation: 103368
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".
Upvotes: 1