共用方式為


FormsAuthenticationConfiguration.LoginUrl 屬性

定義

取得或設定要求的重新導向 URL。

public:
 property System::String ^ LoginUrl { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("loginUrl", DefaultValue="login.aspx")]
[System.Configuration.StringValidator(MinLength=1)]
public string LoginUrl { get; set; }
[<System.Configuration.ConfigurationProperty("loginUrl", DefaultValue="login.aspx")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.LoginUrl : string with get, set
Public Property LoginUrl As String

屬性值

當使用者未獲得驗證時,將要求重新導向到的 URL。 預設值為 login.aspx。

屬性

範例

下列程式代碼範例示範如何存取 LoginUrl。 請參閱類別主題中的 FormsAuthenticationConfiguration 程式碼範例,以瞭解如何取得區段。

// Get the current LoginUrl.
string currentLoginUrl = formsAuthentication.LoginUrl;

// Set the LoginUrl. 
formsAuthentication.LoginUrl = "newLoginUrl";
' Get the current LoginUrl.
  Dim currentLoginUrl As String = _
  formsAuthentication.LoginUrl

' Set the LoginUrl. 
formsAuthentication.LoginUrl = "newLoginUrl"

備註

當使用者未通過驗證或沒有有效的驗證 Cookie 存在時,屬性 LoginUrl 會指定要求的重新導向 URL。

適用於

另請參閱