Accessing logged in user information from inside a module

Discussion in 'ASP .Net' started by Andy B., Feb 22, 2009.

  1. Andy B.

    Andy B. Guest

    I have methods in a module that need to have access to the logged in users
    information for logging purposes. How do I get access to the Membership and
    MembershipUser objects in these methods without having to pass the objects
    to them?
     
    Andy B., Feb 22, 2009
    #1
    1. Advertising

  2. Those routines can instantiate the member objects, but if they are in a
    library, it is better you instantiate and pass them. The main reason here is
    separation of concerns. If the libraries are pulling Membership objects, you
    make the library so it can only be used to log user info in a system that
    uses the default method of setting up membership in the config file, which
    means a web application only. If that constraint is not a horrible thing,
    you can set up the class to do this, even if it breaks encapsulation.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    Blog:
    http://feeds.feedburner.com/GregoryBeamer

    *********************************************
    | Think outside the box |
    *********************************************
    "Andy B." <> wrote in message
    news:...
    >I have methods in a module that need to have access to the logged in users
    >information for logging purposes. How do I get access to the Membership and
    >MembershipUser objects in these methods without having to pass the objects
    >to them?
    >
     
    Cowboy \(Gregory A. Beamer\), Feb 22, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. keithb
    Replies:
    0
    Views:
    638
    keithb
    Feb 16, 2006
  2. Replies:
    1
    Views:
    955
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2007
  3. daokfella
    Replies:
    3
    Views:
    432
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 30, 2007
  4. Shaminda Illangantilaka

    How can I get the current logged user information

    Shaminda Illangantilaka, Jan 4, 2006, in forum: ASP .Net Security
    Replies:
    2
    Views:
    153
    Patrick.O.Ige
    Jan 25, 2006
  5. Kiran More
    Replies:
    2
    Views:
    319
    Kiran More
    Nov 14, 2006
Loading...

Share This Page