module

arbab anis asked on August 4, 2017 12:14

Hello,

How could i add a record each time a module is load by code. Note one Class will always call on module load.which will add its object every time when we click on module.and will show on list of module record

Recent Answers


Trevor Fayas answered on August 4, 2017 15:33

I believe you want to look into Global Event Hooks. The TypeInfo for any given class has Events you can hook onto.

Example:

CMS.Membership.UserInfo.TYPEINFO.Events.Insert.After += Insert_After;

...

 private static void Insert_After(object sender, ObjectEventArgs e)
    {
        // Now you can add a new record that will occur whenever a User is added
    }

If you mean though to add a record whenever a user visits a module user interface page (your question is a bit hard to follow), then you can either extend your user interface or you can create your own and add the logic in the aspx.cs code behind.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.