Dynamicweb 8 Documentation
OnExtranetLoginFailed Field
Example 

User extranet login failed notification. Occurs when authorization failed
Syntax
'Declaration
 
Public Const OnExtranetLoginFailed As String
public const string OnExtranetLoginFailed
Example
Overriding the user extranet login failed notification in DynamicwebOverriding the user extranet login failed notification in Dynamicweb
using System;

namespace Dynamicweb.Examples.CSharp.Notifications.Standard
{
    [Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailed)]
    public class OnExtranetLoginFailedObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            if (args == null)
                return;

            if (!(args is Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs))
                return;

            Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs item = (Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs)args;
            //Throw exception if login is incorrect
            if(item.Reason == Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs.FailReason.IncorrectLogin)
                throw new Exception("IncorrectLogin");
        }
    }
}
Imports System

Namespace Notifications.Standard
    <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailed)> _
    Public Class OnExtranetLoginFailedObserver
        Inherits Global.Dynamicweb.Extensibility.NotificationSubscriber

        Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Global.Dynamicweb.Extensibility.NotificationArgs)
            If args Is Nothing Then
                Return
            End If

            If Not (TypeOf args Is Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs) Then
                Return
            End If

            Dim item As Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs)
            'Throw exception if login is incorrect
            If item.Reason = Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs.FailReason.IncorrectLogin Then
                Throw New Exception("IncorrectLogin")
            End If
        End Sub
    End Class
End Namespace
Remarks
The passed NotificationArgs is Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Standard.User Class
Standard.User Members

Send Feedback