Multiple DestinationPageUrl in 2.0 based NOT on roles, but user table field

Discussion in 'ASP .Net' started by alexandis@gmail.com, Oct 30, 2007.

  1. Guest

    I extended Membership provider, put Login box onto the page,
    associated it with my provider.
    After successful login I need to redirect user based on one of the
    fields in my Logins (Users) table - UserType (i do have roles, but i
    don't use them here). But i can't see how i can access membership
    extended class and all its overridden methods and properties, indeed I
    do not create it explicitly!
     
    , Oct 30, 2007
    #1
    1. Advertising

  2. RE: Multiple DestinationPageUrl in 2.0 based NOT on roles, but user ta

    if you "extended" the Membership class and it is registered properly in your
    web.config, you should be able to access it through the Membership type same
    as you would do before you "extended" it. You aren't providing enough
    information to know what "extended" means here - normally one would write a
    custom provider that inherits from ProviderBase.
    -- peter
    Recursion: see Recursion
    site: http://www.eggheadcafe.com
    unBlog: http://petesbloggerama.blogspot.com
    BlogMetaFinder: http://www.blogmetafinder.com



    "" wrote:

    > I extended Membership provider, put Login box onto the page,
    > associated it with my provider.
    > After successful login I need to redirect user based on one of the
    > fields in my Logins (Users) table - UserType (i do have roles, but i
    > don't use them here). But i can't see how i can access membership
    > extended class and all its overridden methods and properties, indeed I
    > do not create it explicitly!
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Oct 30, 2007
    #2
    1. Advertising

  3. Guest

    Re: Multiple DestinationPageUrl in 2.0 based NOT on roles, but user ta

    Seems like i've made reply to the author.

    Ok, so the question was - should I create my own instance of my
    membership-extended class to get to know additional info about logged
    user like this

    protected void WizardLogin_LoggedIn(object sender, EventArgs e)
    {
    DB2MembershipProvider db2Provider = new DB2MembershipProvider();
    MembershipUser db2user = db2Provider.GetUser(WizardLogin.UserName);
    // and so forth i can get to know all db fields
    }

    or I may somehow get pointer to instance, that has been created when I
    logged-in via Login control?

    Why should I create one more instance, if there was already one
    created with login class?
     
    , Oct 31, 2007
    #3
  4. Guest

    Re: Multiple DestinationPageUrl in 2.0 based NOT on roles, but user ta

    Ok, I can see that my suggestion is wrong - when I put something
    inside of LoggedIn event, I get connection error when just logging-in.
    Maybe I use instantiating incorrectly, but I would rather try to get
    instance reference from login control...
     
    , Oct 31, 2007
    #4
  5. Guest

    Re: Multiple DestinationPageUrl in 2.0 based NOT on roles, but user ta

    Well, getting current membership user object is possible via static
    membership class:
    ....LoggedIn(...) {
    MembershipUser userInfo = Membership.GetUser(WizardLogin.Username,
    true);
    ....
    }

    but I'd like to know how get rid of extra db call - if it really makes
    a sense.
    Maybe I should somehow save all often-required data from logins table
    to use across the pages?
    What is suitable for storing this?
     
    , Oct 31, 2007
    #5
    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. VB Programmer

    Multiple DestinationPageUrl in 2.0

    VB Programmer, Jan 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,296
    VB Programmer
    Jan 9, 2006
  2. 31471Jack3290

    ASP:LOGIN DestinationPageUrl

    31471Jack3290, Sep 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    647
    31471Jack3290
    Sep 27, 2006
  3. tocka20
    Replies:
    0
    Views:
    689
    tocka20
    Jun 4, 2007
  4. Peter
    Replies:
    1
    Views:
    1,204
    Sean Smith
    Jan 21, 2009
  5. jobs
    Replies:
    0
    Views:
    237
Loading...

Share This Page