/folder/ does not point to .aspx page - asp.net

A quick question. Pointing to admin panel in my website on IIS 5.1 (XP Pro) like this
localhost\testsite\admin\
automatically picks default.aspx on my machine but it does not on server2003 which uses IIS 6.0. Do I need to change something for that to work, may be permissions?
Is it a good practice to point to admin/default.aspx or just /admin/. I prefer the later.
Thanks

On your server2003 IIS, have you verified that
Default documents are enabled
Default.aspx is on the list of Default docs
Right-click your website, Properties->Documents

Follow the instructions on this page and ensure that default.aspx is configured as a default document:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/dc6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true

Related

How to set default page of ASP.NET website

I need some help, I have purchased a domain and I am using visual studio to publish the website via FTP. It publishes successfully but when I go into the website I get the Directory Listing Denied error, and I am assuming that this is due to the fact that there is no home page because when I go the address and append /Page.aspx to the address it works fine.
Is there any way that I could set the default page for the website I am publishing to point to the default page?
Please help.
Thanks in advance.
Easy answer: rename your default page to Default.aspx.
Or, if you have access to IIS configuration settings, you can specify the default documents.
YOU need to spesify what page you want to use as your default based on the iis Default Document
You should have access to a ISP control panel where you can specify the default page.
They are usually the same pages in most ISPs:
Default.aspx
Index.aspx

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.

Want to use index.aspx instead of default.aspx in ASP.NET webapp

I want to display index.aspx instead of default.aspx in the root of folders in my ASP.NET app but can't figure out where to set this.
This is a change that you need to make in IIS. Please see Setting Up Default Documents for how to do this:
You can establish a default document
for client requests to a Web site that
does not specify a document name.
Default documents can be a directory's
home page or an index page.
It should be called "Default Document" in your IIS setting.
Here is how to do it in IIS 6 http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/dc6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true
In IIS Manager, right-click the web site and choose properties, click the 'Documents' tab, and add index.aspx to the list.

Running an ASP.net Website from the root

I have an ASP.net Website. the project' content is in a folder called MyWebSite.
When I run my application from Visual Web developer 2008, the browser displays the following address in the address bar:
http: // localhost/ MyWebSite /Default.aspx
I want to be able to run my Website from the following address:
http://localhost/
Can anyone help me please?
Thanks in advance.
Since it is already running on IIS, I would just change the Physical Path of the Default Website. The original value for this field is something like below in IIS7.
%SystemDrive%\inetpub\wwwroot
If you change this field to the path of your MyWebSite folder than you will be able to access the web site from just http://localhost.
I have seen it recommended to change this value from its default as a means of better security. However, I am trying to think of any drawbacks to doing this and the only one I can think of is that hard coding the path might cause some of your other development relative paths to be confusing.
You can go in and change the bindings settings in IIS but I advise against this. If you deploy your site as is, it should resolve correctly on a hosted server (the way you want it). Try this first and see :-)
Create a new website on IIS named MyWebSite, then in Visual Studio do a File->Open->Website. Choose Local IIS and select your website.
Then it will just run it under what ever name you gave the website. In this case you could make it http://MyWebSite/
Note: running Vista and Windows 7 will need elevated privileges.

Classic ASP Error 405

I have several development sites on my wix XP laptop (all classic asp). Doe anyone know why i need to type localhost/site/default.asp (i keep getting a 405 error on iis 5.1) and not just localhost/site
You need to add "Default.asp" as a default document. From this page ...
With iis 4.0 and iis 5.0 the change is
performed as follows:
Start the Internet Service Manager (Start - Programs - Administrative
Tools - Internet Services Manager).
Expand the computer and select the web site.
Right click on it and select Properties.
Select the documents tab.
Check the Enable default document box and click Add to add a new default
name. The order of the search can be
changed by clicking the up and down
arrows.
Click Apply and then OK.
Per comment ... okay, check your script map settings, per this article.
Sounds like you need to configure your default document type in IIS to be default.asp.
First off we need to clear up the web site thing. You only have one web site, the default web site. (It is possible to munge the metabase on XP to create multiple web sites but IIS 5.1 will only serve one of them, the others will have to be stopped).
You have multiple applications which are virtual directories under a common default website.
Have you checked that Default.asp is in the list of default documents for the application not the website? In IIS manager open properties dialog on each applications virtual directory and check the config there.
If you have then you've got a strange one on your hands. At this point I would always advise checking permissions. Does the application allow anonymous access, if so does the anonymous user have access to the folder and files?
This might seem strange advice since accessing the default.asp directly works but in my experience when the configuration looks good and should work but isn't 90% of the time its the result of permissions not correctly set up.
A 405 http response status code means "Method Not Allowed". The Wikipedia article List of HTTP Status Codes has this definition for the error:
A request was made of a resource using
a request method not supported by that
resource; for example, using GET on
a form which requires data to be
presented via POST, or using PUT on a
read-only resource.
You can try the third XP PRO IIS Admin, which can add more than one site to the IIS 5.1, you can switch the site with no difficulty.

Resources