defaultRedirect在web.config中不起作用 [英] defaultRedirect is not working in web.config

查看:56
本文介绍了defaultRedirect在web.config中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

我有一个asp.net项目,它工作正常,但是当我将其上传到网络服务器上时,
我在URL中输入网址(例如www.xyz.com),然后仅显示index.html,而在web.config中,我将更改为

Dear Sir,

I have a asp.net project,it is working fine but when i upload it on webserver then
i enter the web address(e.g.www.xyz.com) in URL then it is showing only index.html,while in web.config, i made changes as

<customerrors mode="On" defaultredirect="Default.aspx"></customerrors>


根据它,它应该显示Default.aspx问题是它仅显示index.html.如果我重命名index.html,则显示404错误(找不到网页).
我需要输入URL后将Default.aspx显示为第一页.

请帮助我.

谢谢
Abhishek


according to it ,it should show the Default.aspx Problem is this it is showing only index.html.If i rename the index.html then it is showing 404 error(web page not found).
My need is i want to display Default.aspx as first page after entering URL.

PLS help me out.

Thanks
Abhishek

推荐答案

我需要的是输入URL后要在第一页上显示Default.aspx.
您从哪里学到/读到/得知要拥有启动页,需要使用"CustomErrors"标签? :doh:

尝试以下方法之一:
-如果您将IIS用作网络服务器(托管环境),则可以在启动页的标签中进行设置.

-您可以在Web项目属性中进行设置.步骤:
1.转到项目的属性,然后设置起始页属性.
2.转到项目的属性
3.转到"Web"选项卡
4.选择特定页面"单选按钮
5.在特定页面"文本框中键入所需的URL

-这样,如果要实现FormAuthentication,则可以使用它来设置起始页.
My need is i want to display Default.aspx as first page after entering URL.
Where did you learnt/read/told-off that to have a startup page you need to use ''CustomErrors'' tag? :doh:

Try one of these:
- If you are using IIS as webserver (hosted environment), there is a tab for startup page where you can set it.

- You can set it in web project properties. Steps:
1. Go to your project''s properties and set the start page property.
2. Go to the project''s Properties
3. Go to the Web tab
4. Select the Specific Page radio button
5. Type in the desired url in the Specific Page text box

- As such, if you are implementing FormAuthentication, then you can use that for setting up the start page.


这篇关于defaultRedirect在web.config中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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