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

  • Thread starter Thread starter alexandis
  • Start date Start date
A

alexandis

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!
 
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
 
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?
 
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...
 
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?
 
Back
Top