Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

External Interfaces

peppertree edited this page Feb 18, 2014 · 1 revision

There is a setting in the update module called "External Interface" and this article is about explaining what you can do with that.

Calling an external interface can help with custom actions that are being executed once a user has updated his account sucessfully on your site. For instance you may want to auto-subscribe a user to an external mailing list.

In order to make that happen, you have to do some coding. Basically you create a simple class library project and add a single class to your project. The project must have a reference to the Connect.Modules.UserManagement.dll and your class must implement our module's interface like so:

` Public Class AccountUpdateAction Implements iAccountUpdate

Public Sub FinalizeAccountUpdate(ByRef Server As HttpServerUtility, ByRef Response As HttpResponse, ByRef Request As HttpRequest, objUser As Entities.Users.UserInfo) Implements iAccountUpdate.FinalizeAccountUpdate
End Sub

End Class `

What you can see is that once you have implemented the interface you get access to everything you need to manipulate the user account or the server's response. For instance, after you have taken whatever action on the account, you may want to call Response.Redirect to a special URL, depending on some of the account's data. The possibilities here are pretty much unlimited.

The interface is almost the last thing being called after updating the account in DNN. The only thing that might happen right after running the interface code is that the redirect per your modulesettings is being executed. But that depends on your code, e.g. once you do anything with the response object, you basically have left the module's code so the module's redirect cannot be executed anymore.

What's left now to make the code run is that you have to tell the account update module what to call. You do that in the module's settings. Watch out for a setting called "External Interface" and enter in the fully qualified name of your interface class in the format

"AssemblyName, ClassName"

for example "MyAssembly, MyNamespace.MyClassName"

That's it.

Clone this wiki locally