FormsAuthentication.DefaultUrl FormsAuthentication.DefaultUrl FormsAuthentication.DefaultUrl FormsAuthentication.DefaultUrl Property

定義

取得未指定重新導向 URL 時,FormsAuthentication 類別將重新導向的 URL。Gets the URL that the FormsAuthentication class will redirect to if no redirect URL is specified.

public:
 static property System::String ^ DefaultUrl { System::String ^ get(); };
public static string DefaultUrl { get; }
member this.DefaultUrl : string
Public Shared ReadOnly Property DefaultUrl As String

屬性值

未指定重新導向 URL 時,FormsAuthentication 類別將重新導向的 URL。The URL that the FormsAuthentication class will redirect to if no redirect URL is specified. 預設值為 "default.aspx"。The default is "default.aspx."

範例

下列程式碼範例將defaultUrlWeb.config 檔案中的屬性。The following code example sets the defaultUrl attribute in the Web.config file.

<authentication mode="Forms">  
  <forms loginUrl="member_login.aspx"  
    defaultUrl="index.aspx" />  
</authentication>  

備註

DefaultUrl屬性值會設定 ASP.NET 應用程式組態檔中,使用defaultUrl屬性form組態項目。The DefaultUrl property value is set in the configuration file for an ASP.NET application by using the defaultUrl attribute of the forms configuration element. DefaultUrl屬性由RedirectFromLoginPage方法如果在要求中不包含任何傳回的 URL。The DefaultUrl property is used by the RedirectFromLoginPage method if no return URL is included in the request. 同樣地,GetRedirectUrl方法會傳回DefaultUrl如果包含在要求中沒有傳回 URL。Similarly, the GetRedirectUrl method will return the DefaultUrl if no return URL is included in the request.

適用於

另請參閱