Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Multiple DestinationPageUrl in 2.0 based NOT on roles, but user table field (http://www.velocityreviews.com/forums/t548146-multiple-destinationpageurl-in-2-0-based-not-on-roles-but-user-table-field.html)

alexandis@gmail.com 10-30-2007 05:54 PM

Multiple DestinationPageUrl in 2.0 based NOT on roles, but user table field
 
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=?= 10-30-2007 06:32 PM

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



"alexandis@gmail.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!
>
>


alexandis@gmail.com 10-31-2007 08:42 AM

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?


alexandis@gmail.com 10-31-2007 08:58 AM

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...


alexandis@gmail.com 10-31-2007 12:41 PM

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?



All times are GMT. The time now is 06:41 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.