ASP.NET网页-链接不起作用 [英] ASP.NET Web page - Links not working

查看:84
本文介绍了ASP.NET网页-链接不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET页.

(此处 [ ^ ])


我正在尝试使其链接到站点中的其他页面.

例如,将鼠标悬停在项目"上,然后在"Cardington"上,该链接会将您带到该站点的另一个页面.

并非如此,它仅指出:

I have an ASP.NET page.

(Here[^])


I am trying to get it to link to other pages in the site.

For example, mouse over ''Projects'' and then ''Cardington'' and the link should take you to another page in the site.

It does not, it merely states:

Not Found
The requested document was not found on this server.



但是,当我通过计算机上的WebMatrix作为本地页面运行此站点时,它运行得很好.

链接页面位于同一(主)目录中.



However, when I run this site through WebMatrix on my machine as a local page it works perfectly well.

The link pages are in the same (main) directory.

Is there something I need to do with the web controls?

推荐答案

我以前遇到过此问题,所以我猜测它有问题与授权有关,您将被重定向回根目录.尝试将以下内容添加到目标目录中的web.config文件中:

对于特定页面,请添加:
I''ve had this problem before and so I''m going to guess that it has something to do with authorization and you''re being redirected back to the root directory. Try adding the following to the web.config file in the destination directory:

For a particular page add:
<br />
<location path="[YOUR.FILE]"><br />
  <system.web><br />
    <authorization><br />
      <allow users="*"/><br />
    </authorization><br />
  </system.web><br />
</location><br />


..或整个目录...


.. or for the whole directory...

<br />
  <system.web><br />
    <authorization><br />
      <allow users="*"/><br />
    </authorization><br />
  </system.web><br />


可能再次出现MIME类型问题.检查这篇文章
ASP.NET网页(剃须刀)疑难解答指南 [ ^ ]
Possibly again MIME Type issue. Check this post
ASP.NET Web Pages (Razor) Troubleshooting Guide[^]


在这种情况下,这似乎是由DNS问题引起的.同样是因为我注意到视觉Web开发人员没有使用相同的端口(不应该这样做).您应该编辑主机文件,并将服务器指向包含网站的文件夹.这可以为您提供帮助.

--Amit
In this case it seems to be caused by a DNS issue. Also because I noticed that visual web developer is not using the same port (something it is not supposed to do). You should edit your hosts file and point the server to the folder containing the website. This could help you.

--Amit


这篇关于ASP.NET网页-链接不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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