0

Why will this not display the failure text? This is using the same FailureText control that displays error messages for log in errors, such as invalid password, and locked or disabled accounts.

Would I have to setup a new control and use that, and if so how?

Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

    If Request.QueryString("suspended") IsNot Nothing Then

        If Request.QueryString("suspended").ToString() = "true" Then

            LoginUser.FailureText = "Your account has been Suspended - Contact the system administrator"

        End If

    End If

End Sub
4

2 回答 2

0

这是代码工作正常:

    If Not String.IsNullOrEmpty(Me.Request.QueryString("suspended")) Then
        If Me.Request.QueryString("suspended").ToLower() = "true" Then
            Me.Login1.FailureText = "Your account has been Suspended - Contact the system administrator"
        End If
    End If

请注意,此方法设置了登录控件的 FailureText,乍一看,似乎什么也没发生。但是在你设置好之后,如果登录失败,你的字符串就会出现。

于 2013-08-11T17:27:11.393 回答
0

它是查询字符串键的大小写问题吗?

尝试这个:

If Request.QueryString("suspended").ToString().ToLower() = "true" Then
    LoginUser.FailureText = "Your account has been Suspended - Contact the system administrator"
End If
于 2013-08-11T12:34:41.677 回答