I have many webpages that need access to the same function call returning me the currently logged in user. How can I place this code globally so that all webpages can take advantage of this code and prevent me from copying and pasting this to all my pages?
'Collection of users in the membership.
Dim MemberColl As MembershipUserCollection
'Finds the user based on the email.
MemberColl = Membership.FindUsersByName(sender.username)
'Enables you to iterate over the collection.
Dim Enumerator As IEnumerator
Enumerator = MemberColl.GetEnumerator
'Needed even get to the first record in the collection.
Dim MemUser As MembershipUser
'Get the user.
MemUser = Enumerator.Current