I want to add some code that runs when a new user is registered on a DotNetNuke site. There is a custom registration module, and I could add code to that. My concern is this registration module is still a work in progress thats not really in my control. Someone could break the code I add or do something unexpected.
Is there another good alternative I can use add code to user membership events?
I'm consider creating a membership provider (either a DNN or ASP.NET provider) that derives from our existing provider. I would extend the implementation of CreateUser() to call the original implementation then my custom code.
The upside is that their is no coupling with the registration component. The downside though- unlike adding an HttpModule where the configuration is indpendent of other aspects of the site- is I will be hiding the existing membership provider. Suppose someone wants to update the provider for another reason- they would have to recompile my class instead of being able to simply change the web.config file.
I was going to created a generic class that derives from MembershipProvider, then use the original provider as the generic type parameter. I was hoping this would like the originaly provider type be included in the web.config definition. Unforuntately C# generics don't allow you to derive from a generic type parameter. :(