asp.net - Handling Login.Authenticate event -


A) I am learning from the book that if we handle , then

Authenticate the event, then we have to authenticate our own users, thus the control will not automatically validate the username and password. I thought the book would suggest that it will only happen when we override the Login. Entrecate () method, but it appears that even if only authenticate Add an event handler for the event, Automatic authentication does not happen

But why is this? Why does not this work with the event like Init or load events, where you must be overridden essentially Page.OnInit () And page Onload () get control over event handling in order?

b

b) I have checked the MSDN site and it basically recommends that if we override log in .onewite () , Us base.OnAuthenticate () . But then, why do we need to override login? Online (), if we have an effect with the announcement of an event handler for logging in. Authorize ?

thanx

You should not override this The methodology is used only for internally registered handlers, if there is currently any authentication or existing subscription provider therefore, the custom authentication applies for log in control To do this, you simply register a handler for the authenticate event and set the property.

Authenticate The event is exactly the same for other events; The only difference is that there is some argument in the oneticetricity method that determines whether < Code> subscription provider or use a registered event handler for authentication.

If you do novels and override login, create a subclass of , base.OnAuthenticate (...) is wise to call because there is a logic that calls the registered event handlers if you do not call base. Authenticate (...) , you should call your registered event handlers, but in your situation, it is probably not possible to create a sub-class of logged in .


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -