asp.net应用程序的默认文件的Index.aspx [英] asp.net application default file Index.aspx

查看:544
本文介绍了asp.net应用程序的默认文件的Index.aspx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么可以把它当我去(例如)的http://本地主机:60288 / 它不给我看一个目录列表,而是打开的Index.aspx 页?这适用的http://本地主机:60288 /的Index.aspx ,但我不希望有的Index.aspx 显示每一次。

how can i make it that when i go to (for example) http://localhost:60288/ it does not show me a directory listing but rather opens the Index.aspx page? This works with http://localhost:60288/Index.aspx but i don't wish to have Index.aspx shown every time.

我也需要像 HTTP链接://本地主机:60288 / A = 1 来工作像的http://本地主机:60288 / Index.aspx的?A = 1 没有的Index.aspx 中。

i also need links like http://localhost:60288/?a=1 to work like http://localhost:60288/Index.aspx?a=1 without the Index.aspx shown.

此使用时,我创造了在Visual Studio网站项目的工作,但现在,我使用的应用程序项目。我该怎么设置呢?

this used to work when i created a website project in visual studio, but now i'm using application project. how can I set this up?

我想/需要这个对所有子文件工作,以及如的http://本地主机:60288 /子文件夹/ 应该工作,如果它是有联系的的http://本地主机:60288 /子文件夹/的Index.aspx

i want / need this to work for all sub folders as well e.g. http://localhost:60288/SubFolder/ should work as if it was linked to http://localhost:60288/SubFolder/Index.aspx

日Thnx

修改仍然没有管理它。

推荐答案

卡西尼(内置由Visual Studio使用的网络服务器)不会允许您配置则使用的默认文档,如果你不指定文件名您的网址。在设置为起始页选项是不一样的事情,因为你发现,因为这不仅影响其在运行的项目页面第一次打开,并且不影响以后的页面负载。

Cassini (the built-in webserver used by Visual Studio) doesn't allow you to configure the Default Document that's used if you don't specify a filename in your URL. The 'Set as Start Page' option isn't the same thing, as you've found, since that only affects which page is first opened when you run the project, and doesn't affect subsequent page-loads.

然而,卡西尼做的有无的默认文档的列表 - 它只是没有配置,并且该列表只包含Default.aspx的和的Default.htm。你可以实现你卡西尼想要的东西,唯一的方法是重新命名所有的Index.aspx的文件的Default.aspx。

However, Cassini does have a list of Default Documents - it just isn't configurable, and the list only contains "default.aspx" and "default.htm". The only way you could achieve what you want in Cassini is to rename all your "index.aspx" files to "default.aspx".

这篇关于asp.net应用程序的默认文件的Index.aspx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆