2008-08-28 26 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

相關問題