<a href=""> to external link returns link/Error in webapp, even though the server is not dead

时间:2017-03-31 15:58:55

标签: c# html web-frontend

I've got 3 links in the header of a .net C# MVC, with the following .cshtml file:

<div id="header">
<div id="manag-nav">
    <a class="manag-page" href="https://EXAMPLE-LINK.com/Account">@Resources.label-A</a>
    <a class="manag-page" href="https://backoffice.EXAMPLE-LINK.com/Sitefinity">@Resources.label-B</a>
    <a class="manag-page website-page" href="http://www.EXAMPLE-LINK.com">@Resources.label-C</a>
</div>
<div id="logo">
    <img src="@Url.Content("~/Content/Images/logo.png")" alt="" />
</div>
<div id="user-login">

</div>

Label1 and label3 links work fine, but my 2nd link, label2, when you click it, it returns " http://backoffice.blabla.com/Error“而不是”http://backoffice.blabla.com/Sitefinity“。

有谁知道为什么会这样?

我忘了提到当我直接进入这个链接时,它可以工作。或者当我在一个简单的.html文件中写下这个url的链接时,它也可以。它只是停止在项目中工作。

1 个答案:

答案 0 :(得分:0)

可能是因为您已经与用户一起登录,并且当您尝试访问/ Sitefinity时,该用户可能没有后端访问权限,或者根据其角色重定向到另一个页面,并且该页面存在问题等等。

长短 - 请确保您没有登录Sitefinity然后尝试链接。

如果你仍然面临这个问题 - 那么最好检查渲染的html输出 - 它可能已被外部javascript修改,或者可能有一个javascript元素的javascript点击处理程序,可能是很多东西。