2008-08-28 45 views

回答

6

使用表单项的LoginUrl属性?

<authentication mode="Forms"> 
    <forms defaultUrl="~/Default.aspx" loginUrl="~/login.aspx" timeout="1440" ></forms> 
</authentication> 
1

我在CoderSource.net找到答案。我不得不把正确的路径放到我的web.config文件中。

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
     ... 
     <!-- 
      The <authentication> section enables configuration 
      of the security authentication mode used by 
      ASP.NET to identify an incoming user. 
     --> 
     <authentication mode="Forms"> 
      <forms loginUrl="~/FolderName/Login.aspx" /> 
     </authentication> 
     ... 
    </system.web> 
    ... 
</configuration> 
+0

什么我在位数的 - 是为什么会发生这种情况摆在首位? – Vidar 2008-10-09 09:20:47

+0

我想默认情况下,微软认为你的根目录下有一个Login.aspx页面:http://domain.com/Login.aspx。您必须更改web.config以覆盖该默认假设。 – 2008-10-09 18:32:10

相关问题