getting Membership userid to use and store in a custom database

Discussion in 'ASP .Net Web Controls' started by TdarTdar, Nov 5, 2005.

  1. TdarTdar

    TdarTdar Guest

    Hello,
    What is the code to retrive the userid of the currently loged in user
    from the asp)user membership databse using the new login controls of
    asp.net 2.

    How do i use that in the "configure database source. What is the source
    would it be profile or from the cookie, and if it is profile what would be in
    teh propery name?


    Tdar
     
    TdarTdar, Nov 5, 2005
    #1
    1. Advertising

  2. Hi Tdar,

    Welcome to ASPNET newsgroup.
    Regarding on the getting Membership userid question, do you mean how to
    access the underlying MembershipUser's identity value(primary key)? Based
    on my understanding, we can get the MembershipUser's underlying database
    identity through the following code:

    ================
    protected void Page_Load(object sender, EventArgs e)
    {
    MembershipUser user = Membership.GetUser();

    Response.Write("<br>Username: " + user.UserName);
    Response.Write("<br>:LastLoginDate " + user.LastLoginDate);
    Response.Write("<br>ProviderUserKey: " +
    user.ProviderUserKey.ToString());
    }
    ================

    the above code help display the current login user's ProviderUserKey.
    However, the "ProviderUserKey contains the underlying user key identity
    which is provider specific(generally it should be transparent to
    developers...). So we do not recommend that we directly use it in our
    asp.net web application. Also, for FormsAuthentication, the authentication
    ticket is cookie based, and I think the authentication ticket only
    contains username as the identity rather than the underlying UserKey.
    Is there any particular scenario in your application that you need to use
    the underlying Provider specific UserKey value? Please feel free to post
    here if you have anything unclear.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)





    --------------------
    | Thread-Topic: getting Membership userid to use and store in a custom
    database
    | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    | X-WBNR-Posting-Host: 24.73.223.27
    | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | Subject: getting Membership userid to use and store in a custom database
    | Date: Sat, 5 Nov 2005 11:01:03 -0800
    | Lines: 13
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | Hello,
    | What is the code to retrive the userid of the currently loged in user
    | from the asp)user membership databse using the new login controls of
    | asp.net 2.
    |
    | How do i use that in the "configure database source. What is the source
    | would it be profile or from the cookie, and if it is profile what would
    be in
    | teh propery name?
    |
    |
    | Tdar
    |
    |
    |
     
    Steven Cheng[MSFT], Nov 7, 2005
    #2
    1. Advertising

  3. TdarTdar

    TdarTdar Guest

    RE: getting Membership userid to use and store in a custom databas

    I would like to use the key in a many to one database the (one being your
    memebership database, many being favorate items for that user) for there
    custom home page. In order to accomplish this I would need the userid
    (unique key) that i can populate as a relationship between the two SQL
    tables. And I would need to query for that information in that table after
    words.

    Tdar

    "Steven Cheng[MSFT]" wrote:

    > Hi Tdar,
    >
    > Welcome to ASPNET newsgroup.
    > Regarding on the getting Membership userid question, do you mean how to
    > access the underlying MembershipUser's identity value(primary key)? Based
    > on my understanding, we can get the MembershipUser's underlying database
    > identity through the following code:
    >
    > ================
    > protected void Page_Load(object sender, EventArgs e)
    > {
    > MembershipUser user = Membership.GetUser();
    >
    > Response.Write("<br>Username: " + user.UserName);
    > Response.Write("<br>:LastLoginDate " + user.LastLoginDate);
    > Response.Write("<br>ProviderUserKey: " +
    > user.ProviderUserKey.ToString());
    > }
    > ================
    >
    > the above code help display the current login user's ProviderUserKey.
    > However, the "ProviderUserKey contains the underlying user key identity
    > which is provider specific(generally it should be transparent to
    > developers...). So we do not recommend that we directly use it in our
    > asp.net web application. Also, for FormsAuthentication, the authentication
    > ticket is cookie based, and I think the authentication ticket only
    > contains username as the identity rather than the underlying UserKey.
    > Is there any particular scenario in your application that you need to use
    > the underlying Provider specific UserKey value? Please feel free to post
    > here if you have anything unclear.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    >
    >
    >
    > --------------------
    > | Thread-Topic: getting Membership userid to use and store in a custom
    > database
    > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    > | X-WBNR-Posting-Host: 24.73.223.27
    > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | Subject: getting Membership userid to use and store in a custom database
    > | Date: Sat, 5 Nov 2005 11:01:03 -0800
    > | Lines: 13
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > |
    > | Hello,
    > | What is the code to retrive the userid of the currently loged in user
    > | from the asp)user membership databse using the new login controls of
    > | asp.net 2.
    > |
    > | How do i use that in the "configure database source. What is the source
    > | would it be profile or from the cookie, and if it is profile what would
    > be in
    > | teh propery name?
    > |
    > |
    > | Tdar
    > |
    > |
    > |
    >
    >
     
    TdarTdar, Nov 7, 2005
    #3
  4. TdarTdar

    TdarTdar Guest

    RE: getting Membership userid to use and store in a custom databas

    What is this in VB?
    MembershipUser user = Membership.GetUser();
    Thanks,
    Tdar


    "Steven Cheng[MSFT]" wrote:

    > Hi Tdar,
    >
    > Welcome to ASPNET newsgroup.
    > Regarding on the getting Membership userid question, do you mean how to
    > access the underlying MembershipUser's identity value(primary key)? Based
    > on my understanding, we can get the MembershipUser's underlying database
    > identity through the following code:
    >
    > ================
    > protected void Page_Load(object sender, EventArgs e)
    > {
    > MembershipUser user = Membership.GetUser();
    >
    > Response.Write("<br>Username: " + user.UserName);
    > Response.Write("<br>:LastLoginDate " + user.LastLoginDate);
    > Response.Write("<br>ProviderUserKey: " +
    > user.ProviderUserKey.ToString());
    > }
    > ================
    >
    > the above code help display the current login user's ProviderUserKey.
    > However, the "ProviderUserKey contains the underlying user key identity
    > which is provider specific(generally it should be transparent to
    > developers...). So we do not recommend that we directly use it in our
    > asp.net web application. Also, for FormsAuthentication, the authentication
    > ticket is cookie based, and I think the authentication ticket only
    > contains username as the identity rather than the underlying UserKey.
    > Is there any particular scenario in your application that you need to use
    > the underlying Provider specific UserKey value? Please feel free to post
    > here if you have anything unclear.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    >
    >
    >
    > --------------------
    > | Thread-Topic: getting Membership userid to use and store in a custom
    > database
    > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    > | X-WBNR-Posting-Host: 24.73.223.27
    > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | Subject: getting Membership userid to use and store in a custom database
    > | Date: Sat, 5 Nov 2005 11:01:03 -0800
    > | Lines: 13
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > |
    > | Hello,
    > | What is the code to retrive the userid of the currently loged in user
    > | from the asp)user membership databse using the new login controls of
    > | asp.net 2.
    > |
    > | How do i use that in the "configure database source. What is the source
    > | would it be profile or from the cookie, and if it is profile what would
    > be in
    > | teh propery name?
    > |
    > |
    > | Tdar
    > |
    > |
    > |
    >
    >
     
    TdarTdar, Nov 7, 2005
    #4
  5. TdarTdar

    TdarTdar Guest

    RE: getting Membership userid to use and store in a custom databas

    Sorry,
    I accually know how to convert it to VB now

    Dim UserInfo as MembershipUser

    Finally understand all this :)

    Tdar

    "TdarTdar" wrote:

    > I would like to use the key in a many to one database the (one being your
    > memebership database, many being favorate items for that user) for there
    > custom home page. In order to accomplish this I would need the userid
    > (unique key) that i can populate as a relationship between the two SQL
    > tables. And I would need to query for that information in that table after
    > words.
    >
    > Tdar
    >
    > "Steven Cheng[MSFT]" wrote:
    >
    > > Hi Tdar,
    > >
    > > Welcome to ASPNET newsgroup.
    > > Regarding on the getting Membership userid question, do you mean how to
    > > access the underlying MembershipUser's identity value(primary key)? Based
    > > on my understanding, we can get the MembershipUser's underlying database
    > > identity through the following code:
    > >
    > > ================
    > > protected void Page_Load(object sender, EventArgs e)
    > > {
    > > MembershipUser user = Membership.GetUser();
    > >
    > > Response.Write("<br>Username: " + user.UserName);
    > > Response.Write("<br>:LastLoginDate " + user.LastLoginDate);
    > > Response.Write("<br>ProviderUserKey: " +
    > > user.ProviderUserKey.ToString());
    > > }
    > > ================
    > >
    > > the above code help display the current login user's ProviderUserKey.
    > > However, the "ProviderUserKey contains the underlying user key identity
    > > which is provider specific(generally it should be transparent to
    > > developers...). So we do not recommend that we directly use it in our
    > > asp.net web application. Also, for FormsAuthentication, the authentication
    > > ticket is cookie based, and I think the authentication ticket only
    > > contains username as the identity rather than the underlying UserKey.
    > > Is there any particular scenario in your application that you need to use
    > > the underlying Provider specific UserKey value? Please feel free to post
    > > here if you have anything unclear.
    > >
    > > Thanks,
    > >
    > > Steven Cheng
    > > Microsoft Online Support
    > >
    > > Get Secure! www.microsoft.com/security
    > > (This posting is provided "AS IS", with no warranties, and confers no
    > > rights.)
    > >
    > >
    > >
    > >
    > >
    > > --------------------
    > > | Thread-Topic: getting Membership userid to use and store in a custom
    > > database
    > > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    > > | X-WBNR-Posting-Host: 24.73.223.27
    > > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > > | Subject: getting Membership userid to use and store in a custom database
    > > | Date: Sat, 5 Nov 2005 11:01:03 -0800
    > > | Lines: 13
    > > | Message-ID: <>
    > > | MIME-Version: 1.0
    > > | Content-Type: text/plain;
    > > | charset="Utf-8"
    > > | Content-Transfer-Encoding: 7bit
    > > | X-Newsreader: Microsoft CDO for Windows 2000
    > > | Content-Class: urn:content-classes:message
    > > | Importance: normal
    > > | Priority: normal
    > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > > | Xref: TK2MSFTNGXA01.phx.gbl
    > > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    > > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > > |
    > > | Hello,
    > > | What is the code to retrive the userid of the currently loged in user
    > > | from the asp)user membership databse using the new login controls of
    > > | asp.net 2.
    > > |
    > > | How do i use that in the "configure database source. What is the source
    > > | would it be profile or from the cookie, and if it is profile what would
    > > be in
    > > | teh propery name?
    > > |
    > > |
    > > | Tdar
    > > |
    > > |
    > > |
    > >
    > >
     
    TdarTdar, Nov 7, 2005
    #5
  6. RE: getting Membership userid to use and store in a custom databas

    Hi Tdar,

    Glad that you've fot it working. Also, it's my pleasure to be of
    assistance. If there're any further things we can help, please feel free to
    post here.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | Thread-Topic: getting Membership userid to use and store in a custom
    databas
    | thread-index: AcXjrk2hkYaS5LRoRZWhNEOKedvxLw==
    | X-WBNR-Posting-Host: 24.73.223.27
    | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | References: <>
    <>
    <>
    | Subject: RE: getting Membership userid to use and store in a custom
    databas
    | Date: Mon, 7 Nov 2005 07:17:01 -0800
    | Lines: 109
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:11743
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | Sorry,
    | I accually know how to convert it to VB now
    |
    | Dim UserInfo as MembershipUser
    |
    | Finally understand all this :)
    |
    | Tdar
    |
    | "TdarTdar" wrote:
    |
    | > I would like to use the key in a many to one database the (one being
    your
    | > memebership database, many being favorate items for that user) for
    there
    | > custom home page. In order to accomplish this I would need the userid
    | > (unique key) that i can populate as a relationship between the two SQL
    | > tables. And I would need to query for that information in that table
    after
    | > words.
    | >
    | > Tdar
    | >
    | > "Steven Cheng[MSFT]" wrote:
    | >
    | > > Hi Tdar,
    | > >
    | > > Welcome to ASPNET newsgroup.
    | > > Regarding on the getting Membership userid question, do you mean how
    to
    | > > access the underlying MembershipUser's identity value(primary key)?
    Based
    | > > on my understanding, we can get the MembershipUser's underlying
    database
    | > > identity through the following code:
    | > >
    | > > ================
    | > > protected void Page_Load(object sender, EventArgs e)
    | > > {
    | > > MembershipUser user = Membership.GetUser();
    | > >
    | > > Response.Write("<br>Username: " + user.UserName);
    | > > Response.Write("<br>:LastLoginDate " + user.LastLoginDate);
    | > > Response.Write("<br>ProviderUserKey: " +
    | > > user.ProviderUserKey.ToString());
    | > > }
    | > > ================
    | > >
    | > > the above code help display the current login user's ProviderUserKey.

    | > > However, the "ProviderUserKey contains the underlying user key
    identity
    | > > which is provider specific(generally it should be transparent to
    | > > developers...). So we do not recommend that we directly use it in our
    | > > asp.net web application. Also, for FormsAuthentication, the
    authentication
    | > > ticket is cookie based, and I think the authentication ticket only
    | > > contains username as the identity rather than the underlying UserKey.
    | > > Is there any particular scenario in your application that you need to
    use
    | > > the underlying Provider specific UserKey value? Please feel free to
    post
    | > > here if you have anything unclear.
    | > >
    | > > Thanks,
    | > >
    | > > Steven Cheng
    | > > Microsoft Online Support
    | > >
    | > > Get Secure! www.microsoft.com/security
    | > > (This posting is provided "AS IS", with no warranties, and confers no
    | > > rights.)
    | > >
    | > >
    | > >
    | > >
    | > >
    | > > --------------------
    | > > | Thread-Topic: getting Membership userid to use and store in a
    custom
    | > > database
    | > > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    | > > | X-WBNR-Posting-Host: 24.73.223.27
    | > > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > > | Subject: getting Membership userid to use and store in a custom
    database
    | > > | Date: Sat, 5 Nov 2005 11:01:03 -0800
    | > > | Lines: 13
    | > > | Message-ID: <>
    | > > | MIME-Version: 1.0
    | > > | Content-Type: text/plain;
    | > > | charset="Utf-8"
    | > > | Content-Transfer-Encoding: 7bit
    | > > | X-Newsreader: Microsoft CDO for Windows 2000
    | > > | Content-Class: urn:content-classes:message
    | > > | Importance: normal
    | > > | Priority: normal
    | > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > > | Xref: TK2MSFTNGXA01.phx.gbl
    | > > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    | > > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > > |
    | > > | Hello,
    | > > | What is the code to retrive the userid of the currently loged in
    user
    | > > | from the asp)user membership databse using the new login
    controls of
    | > > | asp.net 2.
    | > > |
    | > > | How do i use that in the "configure database source. What is the
    source
    | > > | would it be profile or from the cookie, and if it is profile what
    would
    | > > be in
    | > > | teh propery name?
    | > > |
    | > > |
    | > > | Tdar
    | > > |
    | > > |
    | > > |
    | > >
    | > >
    |
     
    Steven Cheng[MSFT], Nov 8, 2005
    #6
  7. TdarTdar

    TdarTdar Guest

    RE: getting Membership userid to use and store in a custom databas

    I am wondering how i could use that in when configuring the data connection.
    should i just throw the userid in a hidden text box and they use the control
    function in the configure dataconnection to do a where query on that user id,
    or is there a better easier way to do that ??



    "Steven Cheng[MSFT]" wrote:

    > Hi Tdar,
    >
    > Glad that you've fot it working. Also, it's my pleasure to be of
    > assistance. If there're any further things we can help, please feel free to
    > post here.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    > --------------------
    > | Thread-Topic: getting Membership userid to use and store in a custom
    > databas
    > | thread-index: AcXjrk2hkYaS5LRoRZWhNEOKedvxLw==
    > | X-WBNR-Posting-Host: 24.73.223.27
    > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | References: <>
    > <>
    > <>
    > | Subject: RE: getting Membership userid to use and store in a custom
    > databas
    > | Date: Mon, 7 Nov 2005 07:17:01 -0800
    > | Lines: 109
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:11743
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > |
    > | Sorry,
    > | I accually know how to convert it to VB now
    > |
    > | Dim UserInfo as MembershipUser
    > |
    > | Finally understand all this :)
    > |
    > | Tdar
    > |
    > | "TdarTdar" wrote:
    > |
    > | > I would like to use the key in a many to one database the (one being
    > your
    > | > memebership database, many being favorate items for that user) for
    > there
    > | > custom home page. In order to accomplish this I would need the userid
    > | > (unique key) that i can populate as a relationship between the two SQL
    > | > tables. And I would need to query for that information in that table
    > after
    > | > words.
    > | >
    > | > Tdar
    > | >
    > | > "Steven Cheng[MSFT]" wrote:
    > | >
    > | > > Hi Tdar,
    > | > >
    > | > > Welcome to ASPNET newsgroup.
    > | > > Regarding on the getting Membership userid question, do you mean how
    > to
    > | > > access the underlying MembershipUser's identity value(primary key)?
    > Based
    > | > > on my understanding, we can get the MembershipUser's underlying
    > database
    > | > > identity through the following code:
    > | > >
    > | > > ================
    > | > > protected void Page_Load(object sender, EventArgs e)
    > | > > {
    > | > > MembershipUser user = Membership.GetUser();
    > | > >
    > | > > Response.Write("<br>Username: " + user.UserName);
    > | > > Response.Write("<br>:LastLoginDate " + user.LastLoginDate);
    > | > > Response.Write("<br>ProviderUserKey: " +
    > | > > user.ProviderUserKey.ToString());
    > | > > }
    > | > > ================
    > | > >
    > | > > the above code help display the current login user's ProviderUserKey.
    >
    > | > > However, the "ProviderUserKey contains the underlying user key
    > identity
    > | > > which is provider specific(generally it should be transparent to
    > | > > developers...). So we do not recommend that we directly use it in our
    > | > > asp.net web application. Also, for FormsAuthentication, the
    > authentication
    > | > > ticket is cookie based, and I think the authentication ticket only
    > | > > contains username as the identity rather than the underlying UserKey.
    > | > > Is there any particular scenario in your application that you need to
    > use
    > | > > the underlying Provider specific UserKey value? Please feel free to
    > post
    > | > > here if you have anything unclear.
    > | > >
    > | > > Thanks,
    > | > >
    > | > > Steven Cheng
    > | > > Microsoft Online Support
    > | > >
    > | > > Get Secure! www.microsoft.com/security
    > | > > (This posting is provided "AS IS", with no warranties, and confers no
    > | > > rights.)
    > | > >
    > | > >
    > | > >
    > | > >
    > | > >
    > | > > --------------------
    > | > > | Thread-Topic: getting Membership userid to use and store in a
    > custom
    > | > > database
    > | > > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    > | > > | X-WBNR-Posting-Host: 24.73.223.27
    > | > > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | > > | Subject: getting Membership userid to use and store in a custom
    > database
    > | > > | Date: Sat, 5 Nov 2005 11:01:03 -0800
    > | > > | Lines: 13
    > | > > | Message-ID: <>
    > | > > | MIME-Version: 1.0
    > | > > | Content-Type: text/plain;
    > | > > | charset="Utf-8"
    > | > > | Content-Transfer-Encoding: 7bit
    > | > > | X-Newsreader: Microsoft CDO for Windows 2000
    > | > > | Content-Class: urn:content-classes:message
    > | > > | Importance: normal
    > | > > | Priority: normal
    > | > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | > > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | > > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | > > | Xref: TK2MSFTNGXA01.phx.gbl
    > | > > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    > | > > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > > |
    > | > > | Hello,
    > | > > | What is the code to retrive the userid of the currently loged in
    > user
    > | > > | from the asp)user membership databse using the new login
    > controls of
    > | > > | asp.net 2.
    > | > > |
    > | > > | How do i use that in the "configure database source. What is the
    > source
    > | > > | would it be profile or from the cookie, and if it is profile what
    > would
    > | > > be in
    > | > > | teh propery name?
    > | > > |
    > | > > |
    > | > > | Tdar
    > | > > |
    > | > > |
    > | > > |
    > | > >
    > | > >
    > |
    >
    >
     
    TdarTdar, Nov 8, 2005
    #7
  8. RE: getting Membership userid to use and store in a custom databas

    Hi Tdar,

    As for the ID , it is used internally by the ServiceProvider which may not
    expose public interfaces for us to query data through that UserKey. So
    what's the information you want to get through this userkey?
    In your former message, you mentioned that
    ===================

    I would like to use the key in a many to one database the (one being your
    memebership database, many being favorate items for that user) for there
    custom home page. In order to accomplish this I would need the userid
    (unique key) that i can populate as a relationship between the two SQL
    tables. And I would need to query for that information in that table after
    words.

    =================

    If I understand well, what you'd like to do is something like the Profile
    service in ASP.NET 2.0. The Profile service can help store personal datas
    (specific to a certain user) so that we can provide some customizable datas
    for users( can work together with MembershipService...) Have you tried the
    Profile service to see if it meet your requirement?

    Here are some related reference on ASP.NET 2.0's profile service:

    #ASP.NET Profile Properties Overview
    http://msdn2.microsoft.com/en-us/library/2y3fs9xs.aspx

    #Storing User Profiles
    http://www.asp.net/QUICKSTART/aspnet/doc/profile/default.aspx#schema

    #Storing User Information with ASP.NET 2.0 Profiles
    http://msdn.microsoft.com/library/en-us/dnvs05/html/userprofiles.asp?frame=t
    rue

    Hope helps. Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)






    --------------------
    | Thread-Topic: getting Membership userid to use and store in a custom
    databas
    | thread-index: AcXkG7DvAqUyrXRVTSWGiRQq1SEVWw==
    | X-WBNR-Posting-Host: 65.35.95.187
    | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | References: <>
    <>
    <>
    <>
    <Q#Y$>
    | Subject: RE: getting Membership userid to use and store in a custom
    databas
    | Date: Mon, 7 Nov 2005 20:20:03 -0800
    | Lines: 184
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:11753
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | I am wondering how i could use that in when configuring the data
    connection.
    | should i just throw the userid in a hidden text box and they use the
    control
    | function in the configure dataconnection to do a where query on that user
    id,
    | or is there a better easier way to do that ??
    |
    |
    |
    | "Steven Cheng[MSFT]" wrote:
    |
    | > Hi Tdar,
    | >
    | > Glad that you've fot it working. Also, it's my pleasure to be of
    | > assistance. If there're any further things we can help, please feel
    free to
    | > post here.
    | >
    | > Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | > --------------------
    | > | Thread-Topic: getting Membership userid to use and store in a custom
    | > databas
    | > | thread-index: AcXjrk2hkYaS5LRoRZWhNEOKedvxLw==
    | > | X-WBNR-Posting-Host: 24.73.223.27
    | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | References: <>
    | > <>
    | > <>
    | > | Subject: RE: getting Membership userid to use and store in a custom
    | > databas
    | > | Date: Mon, 7 Nov 2005 07:17:01 -0800
    | > | Lines: 109
    | > | Message-ID: <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain;
    | > | charset="Utf-8"
    | > | Content-Transfer-Encoding: 7bit
    | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | Content-Class: urn:content-classes:message
    | > | Importance: normal
    | > | Priority: normal
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet.webcontrols:11743
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > |
    | > | Sorry,
    | > | I accually know how to convert it to VB now
    | > |
    | > | Dim UserInfo as MembershipUser
    | > |
    | > | Finally understand all this :)
    | > |
    | > | Tdar
    | > |
    | > | "TdarTdar" wrote:
    | > |
    | > | > I would like to use the key in a many to one database the (one
    being
    | > your
    | > | > memebership database, many being favorate items for that user) for
    | > there
    | > | > custom home page. In order to accomplish this I would need the
    userid
    | > | > (unique key) that i can populate as a relationship between the two
    SQL
    | > | > tables. And I would need to query for that information in that
    table
    | > after
    | > | > words.
    | > | >
    | > | > Tdar
    | > | >
    | > | > "Steven Cheng[MSFT]" wrote:
    | > | >
    | > | > > Hi Tdar,
    | > | > >
    | > | > > Welcome to ASPNET newsgroup.
    | > | > > Regarding on the getting Membership userid question, do you mean
    how
    | > to
    | > | > > access the underlying MembershipUser's identity value(primary
    key)?
    | > Based
    | > | > > on my understanding, we can get the MembershipUser's underlying
    | > database
    | > | > > identity through the following code:
    | > | > >
    | > | > > ================
    | > | > > protected void Page_Load(object sender, EventArgs e)
    | > | > > {
    | > | > > MembershipUser user = Membership.GetUser();
    | > | > >
    | > | > > Response.Write("<br>Username: " + user.UserName);
    | > | > > Response.Write("<br>:LastLoginDate " +
    user.LastLoginDate);
    | > | > > Response.Write("<br>ProviderUserKey: " +
    | > | > > user.ProviderUserKey.ToString());
    | > | > > }
    | > | > > ================
    | > | > >
    | > | > > the above code help display the current login user's
    ProviderUserKey.
    | >
    | > | > > However, the "ProviderUserKey contains the underlying user key
    | > identity
    | > | > > which is provider specific(generally it should be transparent to
    | > | > > developers...). So we do not recommend that we directly use it in
    our
    | > | > > asp.net web application. Also, for FormsAuthentication, the
    | > authentication
    | > | > > ticket is cookie based, and I think the authentication ticket
    only
    | > | > > contains username as the identity rather than the underlying
    UserKey.
    | > | > > Is there any particular scenario in your application that you
    need to
    | > use
    | > | > > the underlying Provider specific UserKey value? Please feel free
    to
    | > post
    | > | > > here if you have anything unclear.
    | > | > >
    | > | > > Thanks,
    | > | > >
    | > | > > Steven Cheng
    | > | > > Microsoft Online Support
    | > | > >
    | > | > > Get Secure! www.microsoft.com/security
    | > | > > (This posting is provided "AS IS", with no warranties, and
    confers no
    | > | > > rights.)
    | > | > >
    | > | > >
    | > | > >
    | > | > >
    | > | > >
    | > | > > --------------------
    | > | > > | Thread-Topic: getting Membership userid to use and store in a
    | > custom
    | > | > > database
    | > | > > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    | > | > > | X-WBNR-Posting-Host: 24.73.223.27
    | > | > > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | > > | Subject: getting Membership userid to use and store in a custom
    | > database
    | > | > > | Date: Sat, 5 Nov 2005 11:01:03 -0800
    | > | > > | Lines: 13
    | > | > > | Message-ID: <>
    | > | > > | MIME-Version: 1.0
    | > | > > | Content-Type: text/plain;
    | > | > > | charset="Utf-8"
    | > | > > | Content-Transfer-Encoding: 7bit
    | > | > > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | > > | Content-Class: urn:content-classes:message
    | > | > > | Importance: normal
    | > | > > | Priority: normal
    | > | > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | > > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | > > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | > > | Xref: TK2MSFTNGXA01.phx.gbl
    | > | > > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    | > | > > | X-Tomcat-NG:
    microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > > |
    | > | > > | Hello,
    | > | > > | What is the code to retrive the userid of the currently
    loged in
    | > user
    | > | > > | from the asp)user membership databse using the new login
    | > controls of
    | > | > > | asp.net 2.
    | > | > > |
    | > | > > | How do i use that in the "configure database source. What is
    the
    | > source
    | > | > > | would it be profile or from the cookie, and if it is profile
    what
    | > would
    | > | > > be in
    | > | > > | teh propery name?
    | > | > > |
    | > | > > |
    | > | > > | Tdar
    | > | > > |
    | > | > > |
    | > | > > |
    | > | > >
    | > | > >
    | > |
    | >
    | >
    |
     
    Steven Cheng[MSFT], Nov 8, 2005
    #8
  9. TdarTdar

    TdarTdar Guest

    RE: getting Membership userid to use and store in a custom databas

    Ok cool, was looking at it and only one question I can think of is say
    besides the shipping cart items, can i store more then one many item list,
    say one list is shopping cart items and antother for say a list of items they
    are interested in. or even another for list of websites they like. OR
    mutliple shipping address, or well etc etc for that user.

    I am going to assume this is yes, because you all are very talented.


    "Steven Cheng[MSFT]" wrote:

    > Hi Tdar,
    >
    > As for the ID , it is used internally by the ServiceProvider which may not
    > expose public interfaces for us to query data through that UserKey. So
    > what's the information you want to get through this userkey?
    > In your former message, you mentioned that
    > ===================
    >
    > I would like to use the key in a many to one database the (one being your
    > memebership database, many being favorate items for that user) for there
    > custom home page. In order to accomplish this I would need the userid
    > (unique key) that i can populate as a relationship between the two SQL
    > tables. And I would need to query for that information in that table after
    > words.
    >
    > =================
    >
    > If I understand well, what you'd like to do is something like the Profile
    > service in ASP.NET 2.0. The Profile service can help store personal datas
    > (specific to a certain user) so that we can provide some customizable datas
    > for users( can work together with MembershipService...) Have you tried the
    > Profile service to see if it meet your requirement?
    >
    > Here are some related reference on ASP.NET 2.0's profile service:
    >
    > #ASP.NET Profile Properties Overview
    > http://msdn2.microsoft.com/en-us/library/2y3fs9xs.aspx
    >
    > #Storing User Profiles
    > http://www.asp.net/QUICKSTART/aspnet/doc/profile/default.aspx#schema
    >
    > #Storing User Information with ASP.NET 2.0 Profiles
    > http://msdn.microsoft.com/library/en-us/dnvs05/html/userprofiles.asp?frame=t
    > rue
    >
    > Hope helps. Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    >
    >
    >
    >
    > --------------------
    > | Thread-Topic: getting Membership userid to use and store in a custom
    > databas
    > | thread-index: AcXkG7DvAqUyrXRVTSWGiRQq1SEVWw==
    > | X-WBNR-Posting-Host: 65.35.95.187
    > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | References: <>
    > <>
    > <>
    > <>
    > <Q#Y$>
    > | Subject: RE: getting Membership userid to use and store in a custom
    > databas
    > | Date: Mon, 7 Nov 2005 20:20:03 -0800
    > | Lines: 184
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:11753
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > |
    > | I am wondering how i could use that in when configuring the data
    > connection.
    > | should i just throw the userid in a hidden text box and they use the
    > control
    > | function in the configure dataconnection to do a where query on that user
    > id,
    > | or is there a better easier way to do that ??
    > |
    > |
    > |
    > | "Steven Cheng[MSFT]" wrote:
    > |
    > | > Hi Tdar,
    > | >
    > | > Glad that you've fot it working. Also, it's my pleasure to be of
    > | > assistance. If there're any further things we can help, please feel
    > free to
    > | > post here.
    > | >
    > | > Thanks,
    > | >
    > | > Steven Cheng
    > | > Microsoft Online Support
    > | >
    > | > Get Secure! www.microsoft.com/security
    > | > (This posting is provided "AS IS", with no warranties, and confers no
    > | > rights.)
    > | >
    > | >
    > | > --------------------
    > | > | Thread-Topic: getting Membership userid to use and store in a custom
    > | > databas
    > | > | thread-index: AcXjrk2hkYaS5LRoRZWhNEOKedvxLw==
    > | > | X-WBNR-Posting-Host: 24.73.223.27
    > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | > | References: <>
    > | > <>
    > | > <>
    > | > | Subject: RE: getting Membership userid to use and store in a custom
    > | > databas
    > | > | Date: Mon, 7 Nov 2005 07:17:01 -0800
    > | > | Lines: 109
    > | > | Message-ID: <>
    > | > | MIME-Version: 1.0
    > | > | Content-Type: text/plain;
    > | > | charset="Utf-8"
    > | > | Content-Transfer-Encoding: 7bit
    > | > | X-Newsreader: Microsoft CDO for Windows 2000
    > | > | Content-Class: urn:content-classes:message
    > | > | Importance: normal
    > | > | Priority: normal
    > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | > | Xref: TK2MSFTNGXA01.phx.gbl
    > | > microsoft.public.dotnet.framework.aspnet.webcontrols:11743
    > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > |
    > | > | Sorry,
    > | > | I accually know how to convert it to VB now
    > | > |
    > | > | Dim UserInfo as MembershipUser
    > | > |
    > | > | Finally understand all this :)
    > | > |
    > | > | Tdar
    > | > |
    > | > | "TdarTdar" wrote:
    > | > |
    > | > | > I would like to use the key in a many to one database the (one
    > being
    > | > your
    > | > | > memebership database, many being favorate items for that user) for
    > | > there
    > | > | > custom home page. In order to accomplish this I would need the
    > userid
    > | > | > (unique key) that i can populate as a relationship between the two
    > SQL
    > | > | > tables. And I would need to query for that information in that
    > table
    > | > after
    > | > | > words.
    > | > | >
    > | > | > Tdar
    > | > | >
    > | > | > "Steven Cheng[MSFT]" wrote:
    > | > | >
    > | > | > > Hi Tdar,
    > | > | > >
    > | > | > > Welcome to ASPNET newsgroup.
    > | > | > > Regarding on the getting Membership userid question, do you mean
    > how
    > | > to
    > | > | > > access the underlying MembershipUser's identity value(primary
    > key)?
    > | > Based
    > | > | > > on my understanding, we can get the MembershipUser's underlying
    > | > database
    > | > | > > identity through the following code:
    > | > | > >
    > | > | > > ================
    > | > | > > protected void Page_Load(object sender, EventArgs e)
    > | > | > > {
    > | > | > > MembershipUser user = Membership.GetUser();
    > | > | > >
    > | > | > > Response.Write("<br>Username: " + user.UserName);
    > | > | > > Response.Write("<br>:LastLoginDate " +
    > user.LastLoginDate);
    > | > | > > Response.Write("<br>ProviderUserKey: " +
    > | > | > > user.ProviderUserKey.ToString());
    > | > | > > }
    > | > | > > ================
    > | > | > >
    > | > | > > the above code help display the current login user's
    > ProviderUserKey.
    > | >
    > | > | > > However, the "ProviderUserKey contains the underlying user key
    > | > identity
    > | > | > > which is provider specific(generally it should be transparent to
    > | > | > > developers...). So we do not recommend that we directly use it in
    > our
    > | > | > > asp.net web application. Also, for FormsAuthentication, the
    > | > authentication
    > | > | > > ticket is cookie based, and I think the authentication ticket
    > only
    > | > | > > contains username as the identity rather than the underlying
    > UserKey.
    > | > | > > Is there any particular scenario in your application that you
    > need to
    > | > use
    > | > | > > the underlying Provider specific UserKey value? Please feel free
    > to
    > | > post
    > | > | > > here if you have anything unclear.
    > | > | > >
    > | > | > > Thanks,
    > | > | > >
    > | > | > > Steven Cheng
    > | > | > > Microsoft Online Support
    > | > | > >
    > | > | > > Get Secure! www.microsoft.com/security
    > | > | > > (This posting is provided "AS IS", with no warranties, and
    > confers no
    > | > | > > rights.)
    > | > | > >
    > | > | > >
    > | > | > >
    > | > | > >
    > | > | > >
    > | > | > > --------------------
    > | > | > > | Thread-Topic: getting Membership userid to use and store in a
    > | > custom
    > | > | > > database
    > | > | > > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    > | > | > > | X-WBNR-Posting-Host: 24.73.223.27
    > | > | > > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | > | > > | Subject: getting Membership userid to use and store in a custom
    > | > database
    > | > | > > | Date: Sat, 5 Nov 2005 11:01:03 -0800
    > | > | > > | Lines: 13
    > | > | > > | Message-ID: <>
    > | > | > > | MIME-Version: 1.0
    > | > | > > | Content-Type: text/plain;
    > | > | > > | charset="Utf-8"
    > | > | > > | Content-Transfer-Encoding: 7bit
    > | > | > > | X-Newsreader: Microsoft CDO for Windows 2000
    > | > | > > | Content-Class: urn:content-classes:message
    > | > | > > | Importance: normal
    > | > | > > | Priority: normal
    > | > | > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | > | > > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > | > > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | > | > > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | > | > > | Xref: TK2MSFTNGXA01.phx.gbl
    > | > | > > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    > | > | > > | X-Tomcat-NG:
    > microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > | > > |
    > | > | > > | Hello,
    > | > | > > | What is the code to retrive the userid of the currently
    > loged in
    > | > user
    > | > | > > | from the asp)user membership databse using the new login
    > | > controls of
    > | > | > > | asp.net 2.
    > | > | > > |
    > | > | > > | How do i use that in the "configure database source. What is
    > the
    > | > source
    > | > | > > | would it be profile or from the cookie, and if it is profile
    > what
    > | > would
    > | > | > > be in
    > | > | > > | teh propery name?
    > | > | > > |
    > | > | > > |
    > | > | > > | Tdar
    > | > | > > |
    > | > | > > |
    > | > | > > |
    > | > | > >
    > | > | > >
    > | > |
    > | >
    > | >
    > |
    >
    >
     
    TdarTdar, Nov 8, 2005
    #9
  10. RE: getting Membership userid to use and store in a custom databas

    Thanks for your response Tdar,

    As for the profile service, it can be configured to use any different
    underlying data strorage as long as there is proper provider for it(By
    default we use Sql data store). And of course we can store mutliple lists
    or other class instance or objects in the profile db for each user , the
    requirement is that those class must be serializable (since it'll be
    serialized before persisted into profile db...).

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | Thread-Topic: getting Membership userid to use and store in a custom
    databas
    | thread-index: AcXkbmloXup2uoowQ5Kem787opk45A==
    | X-WBNR-Posting-Host: 65.35.95.187
    | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | References: <>
    <>
    <>
    <>
    <Q#Y$>
    <>
    <>
    | Subject: RE: getting Membership userid to use and store in a custom
    databas
    | Date: Tue, 8 Nov 2005 06:12:11 -0800
    | Lines: 301
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:11763
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | Ok cool, was looking at it and only one question I can think of is say
    | besides the shipping cart items, can i store more then one many item
    list,
    | say one list is shopping cart items and antother for say a list of items
    they
    | are interested in. or even another for list of websites they like. OR
    | mutliple shipping address, or well etc etc for that user.
    |
    | I am going to assume this is yes, because you all are very talented.
    |
    |
    | "Steven Cheng[MSFT]" wrote:
    |
    | > Hi Tdar,
    | >
    | > As for the ID , it is used internally by the ServiceProvider which may
    not
    | > expose public interfaces for us to query data through that UserKey. So
    | > what's the information you want to get through this userkey?
    | > In your former message, you mentioned that
    | > ===================
    | >
    | > I would like to use the key in a many to one database the (one being
    your
    | > memebership database, many being favorate items for that user) for
    there
    | > custom home page. In order to accomplish this I would need the userid
    | > (unique key) that i can populate as a relationship between the two SQL
    | > tables. And I would need to query for that information in that table
    after
    | > words.
    | >
    | > =================
    | >
    | > If I understand well, what you'd like to do is something like the
    Profile
    | > service in ASP.NET 2.0. The Profile service can help store personal
    datas
    | > (specific to a certain user) so that we can provide some customizable
    datas
    | > for users( can work together with MembershipService...) Have you tried
    the
    | > Profile service to see if it meet your requirement?
    | >
    | > Here are some related reference on ASP.NET 2.0's profile service:
    | >
    | > #ASP.NET Profile Properties Overview
    | > http://msdn2.microsoft.com/en-us/library/2y3fs9xs.aspx
    | >
    | > #Storing User Profiles
    | > http://www.asp.net/QUICKSTART/aspnet/doc/profile/default.aspx#schema
    | >
    | > #Storing User Information with ASP.NET 2.0 Profiles
    | >
    http://msdn.microsoft.com/library/en-us/dnvs05/html/userprofiles.asp?frame=t
    | > rue
    | >
    | > Hope helps. Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | >
    | >
    | >
    | >
    | > --------------------
    | > | Thread-Topic: getting Membership userid to use and store in a custom
    | > databas
    | > | thread-index: AcXkG7DvAqUyrXRVTSWGiRQq1SEVWw==
    | > | X-WBNR-Posting-Host: 65.35.95.187
    | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | References: <>
    | > <>
    | > <>
    | > <>
    | > <Q#Y$>
    | > | Subject: RE: getting Membership userid to use and store in a custom
    | > databas
    | > | Date: Mon, 7 Nov 2005 20:20:03 -0800
    | > | Lines: 184
    | > | Message-ID: <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain;
    | > | charset="Utf-8"
    | > | Content-Transfer-Encoding: 7bit
    | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | Content-Class: urn:content-classes:message
    | > | Importance: normal
    | > | Priority: normal
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet.webcontrols:11753
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > |
    | > | I am wondering how i could use that in when configuring the data
    | > connection.
    | > | should i just throw the userid in a hidden text box and they use the
    | > control
    | > | function in the configure dataconnection to do a where query on that
    user
    | > id,
    | > | or is there a better easier way to do that ??
    | > |
    | > |
    | > |
    | > | "Steven Cheng[MSFT]" wrote:
    | > |
    | > | > Hi Tdar,
    | > | >
    | > | > Glad that you've fot it working. Also, it's my pleasure to be of
    | > | > assistance. If there're any further things we can help, please feel
    | > free to
    | > | > post here.
    | > | >
    | > | > Thanks,
    | > | >
    | > | > Steven Cheng
    | > | > Microsoft Online Support
    | > | >
    | > | > Get Secure! www.microsoft.com/security
    | > | > (This posting is provided "AS IS", with no warranties, and confers
    no
    | > | > rights.)
    | > | >
    | > | >
    | > | > --------------------
    | > | > | Thread-Topic: getting Membership userid to use and store in a
    custom
    | > | > databas
    | > | > | thread-index: AcXjrk2hkYaS5LRoRZWhNEOKedvxLw==
    | > | > | X-WBNR-Posting-Host: 24.73.223.27
    | > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | > | References: <>
    | > | > <>
    | > | > <>
    | > | > | Subject: RE: getting Membership userid to use and store in a
    custom
    | > | > databas
    | > | > | Date: Mon, 7 Nov 2005 07:17:01 -0800
    | > | > | Lines: 109
    | > | > | Message-ID: <>
    | > | > | MIME-Version: 1.0
    | > | > | Content-Type: text/plain;
    | > | > | charset="Utf-8"
    | > | > | Content-Transfer-Encoding: 7bit
    | > | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | > | Content-Class: urn:content-classes:message
    | > | > | Importance: normal
    | > | > | Priority: normal
    | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > | > microsoft.public.dotnet.framework.aspnet.webcontrols:11743
    | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > |
    | > | > | Sorry,
    | > | > | I accually know how to convert it to VB now
    | > | > |
    | > | > | Dim UserInfo as MembershipUser
    | > | > |
    | > | > | Finally understand all this :)
    | > | > |
    | > | > | Tdar
    | > | > |
    | > | > | "TdarTdar" wrote:
    | > | > |
    | > | > | > I would like to use the key in a many to one database the (one
    | > being
    | > | > your
    | > | > | > memebership database, many being favorate items for that user)
    for
    | > | > there
    | > | > | > custom home page. In order to accomplish this I would need the
    | > userid
    | > | > | > (unique key) that i can populate as a relationship between the
    two
    | > SQL
    | > | > | > tables. And I would need to query for that information in that
    | > table
    | > | > after
    | > | > | > words.
    | > | > | >
    | > | > | > Tdar
    | > | > | >
    | > | > | > "Steven Cheng[MSFT]" wrote:
    | > | > | >
    | > | > | > > Hi Tdar,
    | > | > | > >
    | > | > | > > Welcome to ASPNET newsgroup.
    | > | > | > > Regarding on the getting Membership userid question, do you
    mean
    | > how
    | > | > to
    | > | > | > > access the underlying MembershipUser's identity value(primary
    | > key)?
    | > | > Based
    | > | > | > > on my understanding, we can get the MembershipUser's
    underlying
    | > | > database
    | > | > | > > identity through the following code:
    | > | > | > >
    | > | > | > > ================
    | > | > | > > protected void Page_Load(object sender, EventArgs e)
    | > | > | > > {
    | > | > | > > MembershipUser user = Membership.GetUser();
    | > | > | > >
    | > | > | > > Response.Write("<br>Username: " + user.UserName);
    | > | > | > > Response.Write("<br>:LastLoginDate " +
    | > user.LastLoginDate);
    | > | > | > > Response.Write("<br>ProviderUserKey: " +
    | > | > | > > user.ProviderUserKey.ToString());
    | > | > | > > }
    | > | > | > > ================
    | > | > | > >
    | > | > | > > the above code help display the current login user's
    | > ProviderUserKey.
    | > | >
    | > | > | > > However, the "ProviderUserKey contains the underlying user
    key
    | > | > identity
    | > | > | > > which is provider specific(generally it should be transparent
    to
    | > | > | > > developers...). So we do not recommend that we directly use
    it in
    | > our
    | > | > | > > asp.net web application. Also, for FormsAuthentication, the
    | > | > authentication
    | > | > | > > ticket is cookie based, and I think the authentication
    ticket
    | > only
    | > | > | > > contains username as the identity rather than the underlying
    | > UserKey.
    | > | > | > > Is there any particular scenario in your application that you
    | > need to
    | > | > use
    | > | > | > > the underlying Provider specific UserKey value? Please feel
    free
    | > to
    | > | > post
    | > | > | > > here if you have anything unclear.
    | > | > | > >
    | > | > | > > Thanks,
    | > | > | > >
    | > | > | > > Steven Cheng
    | > | > | > > Microsoft Online Support
    | > | > | > >
    | > | > | > > Get Secure! www.microsoft.com/security
    | > | > | > > (This posting is provided "AS IS", with no warranties, and
    | > confers no
    | > | > | > > rights.)
    | > | > | > >
    | > | > | > >
    | > | > | > >
    | > | > | > >
    | > | > | > >
    | > | > | > > --------------------
    | > | > | > > | Thread-Topic: getting Membership userid to use and store in
    a
    | > | > custom
    | > | > | > > database
    | > | > | > > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
    | > | > | > > | X-WBNR-Posting-Host: 24.73.223.27
    | > | > | > > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | > | > > | Subject: getting Membership userid to use and store in a
    custom
    | > | > database
    | > | > | > > | Date: Sat, 5 Nov 2005 11:01:03 -0800
    | > | > | > > | Lines: 13
    | > | > | > > | Message-ID:
    <>
    | > | > | > > | MIME-Version: 1.0
    | > | > | > > | Content-Type: text/plain;
    | > | > | > > | charset="Utf-8"
    | > | > | > > | Content-Transfer-Encoding: 7bit
    | > | > | > > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | > | > > | Content-Class: urn:content-classes:message
    | > | > | > > | Importance: normal
    | > | > | > > | Priority: normal
    | > | > | > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | > | > > | Newsgroups:
    microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > | > > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | > | > > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | > | > > | Xref: TK2MSFTNGXA01.phx.gbl
    | > | > | > > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
    | > | > | > > | X-Tomcat-NG:
    | > microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > | > > |
    | > | > | > > | Hello,
    | > | > | > > | What is the code to retrive the userid of the currently
    | > loged in
    | > | > user
    | > | > | > > | from the asp)user membership databse using the new
    login
    | > | > controls of
    | > | > | > > | asp.net 2.
    | > | > | > > |
    | > | > | > > | How do i use that in the "configure database source. What
    is
    | > the
    | > | > source
    | > | > | > > | would it be profile or from the cookie, and if it is
    profile
    | > what
    | > | > would
    | > | > | > > be in
    | > | > | > > | teh propery name?
    | > | > | > > |
    | > | > | > > |
    | > | > | > > | Tdar
    | > | > | > > |
    | > | > | > > |
    | > | > | > > |
    | > | > | > >
    | > | > | > >
    | > | > |
    | > | >
    | > | >
    | > |
    | >
    | >
    |
     
    Steven Cheng[MSFT], Nov 9, 2005
    #10
  11. TdarTdar

    TdarTdar Guest

    RE: getting Membership userid to use and store in a custom databas

    Hello,
    Ok I have been this profile stuff somewhat working,
    however it is not saving the profile info for each user right here is the
    record of the two differnt users from the asp_profile table:
    record 1 shippingtest user
    {AF8020C2-4D36-47EE-B4EE-4D42AE080FD0}
    PreferredBackgroundColor:B:0:187:<Binary> 11/15/2005 3:57:22 PM
    record 2 djp user
    {8DFE1B7D-2637-4DB8-862C-296F277BA77E}dbman_id_letter:S:0:1:preferredBackgroundColor:B:0:187:dbman_user_password:S:1:4: QDP99 <Binary> 11/15/2005
    3:55:20 PM

    the page code is : ( i do use master pages)

    Enter your preferred background color:
    <asp:DropDownList ID="ddlColor" runat="server">
    <asp:ListItem>Aqua</asp:ListItem>
    </asp:DropDownList><br />
    <br />
    Enter your dbman email letter(case sensitive):<br />
    <asp:TextBox ID="dbmanletter" runat="server"></asp:TextBox><br />
    <br />
    Enter your dbman sales code:<br />
    <asp:TextBox ID="dbmancode" runat="server"></asp:TextBox><br />
    <br />
    <asp:button id="btnUpdatePreferences" runat="server" text="Click
    to update your profile" onclick="btnUpdatePreferences_Click" />
    <br />

    The code behind is:

    Partial Class MyProfile
    Inherits System.Web.UI.Page

    Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e As
    System.EventArgs)
    'Profile.PreferredBackgroundColor =
    Color.FromName(ddlColor.SelectedValue)
    Profile.dbman_id_letter = dbmanletter.Text
    Profile.dbman_user_password = dbmancode.Text
    Response.Redirect(Request.Url.LocalPath)
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load
    dbmancode.Text = Profile.dbman_user_password
    dbmanletter.Text = Profile.dbman_id_letter
    End Sub
    End Class

    I commented out this time because i am not sure yet and have not researched
    yet how to put system.drawing in a code behind page thus i commented out
    that line
    'Profile.PreferredBackgroundColor = Color.FromName(ddlColor.SelectedValue)

    for the djp user the stuff works file, but for the other shiptest users the
    dbman letter and dbman code do not save

    I really hope you expand on this prfile area in the future because I dont
    see it being a viable for storeing a customers multiple shipping address
    (unless it is because i have nto played with the seralization yet) and then
    for creating reports such as mailing list using there address i see there has
    to be alot of extra work splitting up the fields to pull the data directly
    from the database for say a crystal report..

    Tdar









    "Steven Cheng[MSFT]" wrote:

    > Thanks for your response Tdar,
    >
    > As for the profile service, it can be configured to use any different
    > underlying data strorage as long as there is proper provider for it(By
    > default we use Sql data store). And of course we can store mutliple lists
    > or other class instance or objects in the profile db for each user , the
    > requirement is that those class must be serializable (since it'll be
    > serialized before persisted into profile db...).
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    > --------------------
    > | Thread-Topic: getting Membership userid to use and store in a custom
    > databas
    > | thread-index: AcXkbmloXup2uoowQ5Kem787opk45A==
    > | X-WBNR-Posting-Host: 65.35.95.187
    > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | References: <>
    > <>
    > <>
    > <>
    > <Q#Y$>
    > <>
    > <>
    > | Subject: RE: getting Membership userid to use and store in a custom
    > databas
    > | Date: Tue, 8 Nov 2005 06:12:11 -0800
    > | Lines: 301
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:11763
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > |
    > | Ok cool, was looking at it and only one question I can think of is say
    > | besides the shipping cart items, can i store more then one many item
    > list,
    > | say one list is shopping cart items and antother for say a list of items
    > they
    > | are interested in. or even another for list of websites they like. OR
    > | mutliple shipping address, or well etc etc for that user.
    > |
    > | I am going to assume this is yes, because you all are very talented.
    > |
    > |
    > | "Steven Cheng[MSFT]" wrote:
    > |
    > | > Hi Tdar,
    > | >
    > | > As for the ID , it is used internally by the ServiceProvider which may
    > not
    > | > expose public interfaces for us to query data through that UserKey. So
    > | > what's the information you want to get through this userkey?
    > | > In your former message, you mentioned that
    > | > ===================
    > | >
    > | > I would like to use the key in a many to one database the (one being
    > your
    > | > memebership database, many being favorate items for that user) for
    > there
    > | > custom home page. In order to accomplish this I would need the userid
    > | > (unique key) that i can populate as a relationship between the two SQL
    > | > tables. And I would need to query for that information in that table
    > after
    > | > words.
    > | >
    > | > =================
    > | >
    > | > If I understand well, what you'd like to do is something like the
    > Profile
    > | > service in ASP.NET 2.0. The Profile service can help store personal
    > datas
    > | > (specific to a certain user) so that we can provide some customizable
    > datas
    > | > for users( can work together with MembershipService...) Have you tried
    > the
    > | > Profile service to see if it meet your requirement?
    > | >
    > | > Here are some related reference on ASP.NET 2.0's profile service:
    > | >
    > | > #ASP.NET Profile Properties Overview
    > | > http://msdn2.microsoft.com/en-us/library/2y3fs9xs.aspx
    > | >
    > | > #Storing User Profiles
    > | > http://www.asp.net/QUICKSTART/aspnet/doc/profile/default.aspx#schema
    > | >
    > | > #Storing User Information with ASP.NET 2.0 Profiles
    > | >
    > http://msdn.microsoft.com/library/en-us/dnvs05/html/userprofiles.asp?frame=t
    > | > rue
    > | >
    > | > Hope helps. Thanks,
    > | >
    > | > Steven Cheng
    > | > Microsoft Online Support
    > | >
    > | > Get Secure! www.microsoft.com/security
    > | > (This posting is provided "AS IS", with no warranties, and confers no
    > | > rights.)
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | > --------------------
    > | > | Thread-Topic: getting Membership userid to use and store in a custom
    > | > databas
    > | > | thread-index: AcXkG7DvAqUyrXRVTSWGiRQq1SEVWw==
    > | > | X-WBNR-Posting-Host: 65.35.95.187
    > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | > | References: <>
    > | > <>
    > | > <>
    > | > <>
    > | > <Q#Y$>
    > | > | Subject: RE: getting Membership userid to use and store in a custom
    > | > databas
    > | > | Date: Mon, 7 Nov 2005 20:20:03 -0800
    > | > | Lines: 184
    > | > | Message-ID: <>
    > | > | MIME-Version: 1.0
    > | > | Content-Type: text/plain;
    > | > | charset="Utf-8"
    > | > | Content-Transfer-Encoding: 7bit
    > | > | X-Newsreader: Microsoft CDO for Windows 2000
    > | > | Content-Class: urn:content-classes:message
    > | > | Importance: normal
    > | > | Priority: normal
    > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | > | Xref: TK2MSFTNGXA01.phx.gbl
    > | > microsoft.public.dotnet.framework.aspnet.webcontrols:11753
    > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > |
    > | > | I am wondering how i could use that in when configuring the data
    > | > connection.
    > | > | should i just throw the userid in a hidden text box and they use the
    > | > control
    > | > | function in the configure dataconnection to do a where query on that
    > user
    > | > id,
    > | > | or is there a better easier way to do that ??
    > | > |
    > | > |
    > | > |
    > | > | "Steven Cheng[MSFT]" wrote:
    > | > |
    > | > | > Hi Tdar,
    > | > | >
    > | > | > Glad that you've fot it working. Also, it's my pleasure to be of
    > | > | > assistance. If there're any further things we can help, please feel
    > | > free to
    > | > | > post here.
    > | > | >
    > | > | > Thanks,
    > | > | >
    > | > | > Steven Cheng
    > | > | > Microsoft Online Support
    > | > | >
    > | > | > Get Secure! www.microsoft.com/security
    > | > | > (This posting is provided "AS IS", with no warranties, and confers
    > no
    > | > | > rights.)
    > | > | >
    > | > | >
    > | > | > --------------------
    > | > | > | Thread-Topic: getting Membership userid to use and store in a
    > custom
    > | > | > databas
    > | > | > | thread-index: AcXjrk2hkYaS5LRoRZWhNEOKedvxLw==
    > | > | > | X-WBNR-Posting-Host: 24.73.223.27
    > | > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | > | > | References: <>
    > | > | > <>
    > | > | > <>
    > | > | > | Subject: RE: getting Membership userid to use and store in a
    > custom
    > | > | > databas
    > | > | > | Date: Mon, 7 Nov 2005 07:17:01 -0800
    > | > | > | Lines: 109
    > | > | > | Message-ID: <>
    > | > | > | MIME-Version: 1.0
    > | > | > | Content-Type: text/plain;
    > | > | > | charset="Utf-8"
    > | > | > | Content-Transfer-Encoding: 7bit
    > | > | > | X-Newsreader: Microsoft CDO for Windows 2000
    > | > | > | Content-Class: urn:content-classes:message
    > | > | > | Importance: normal
    > | > | > | Priority: normal
    > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | > | > | Xref: TK2MSFTNGXA01.phx.gbl
    > | > | > microsoft.public.dotnet.framework.aspnet.webcontrols:11743
    > | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | > | > |
    > | > | > | Sorry,
    > | > | > | I accually know how to convert it to VB now
    > | > | > |
    > | > | > | Dim UserInfo as MembershipUser
    > | > | > |
    > | > | > | Finally understand all this :)
    > | > | > |
    > | > | > | Tdar
    > | > | > |
    > | > | > | "TdarTdar" wrote:
    > | > | > |
    > | > | > | > I would like to use the key in a many to one database the (one
    > | > being
    > | > | > your
    > | > | > | > memebership database, many being favorate items for that user)
    > for
    > | > | > there
    > | > | > | > custom home page. In order to accomplish this I would need the
    > | > userid
    > | > | > | > (unique key) that i can populate as a relationship between the
    > two
    > | > SQL
    > | > | > | > tables. And I would need to query for that information in that
    > | > table
    > | > | > after
    > | > | > | > words.
    > | > | > | >
    > | > | > | > Tdar
    > | > | > | >
    > | > | > | > "Steven Cheng[MSFT]" wrote:
    > | > | > | >
    > | > | > | > > Hi Tdar,
    > | > | > | > >
    > | > | > | > > Welcome to ASPNET newsgroup.
    > | > | > | > > Regarding on the getting Membership userid question, do you
    > mean
    > | > how
    > | > | > to
    > | > | > | > > access the underlying MembershipUser's identity value(primary
    > | > key)?
    > | > | > Based
    > | > | > | > > on my understanding, we can get the MembershipUser's
    > underlying
    > | > | > database
    > | > | > | > > identity through the following code:
    > | > | > | > >
    > | > | > | > > ================
    > | > | > | > > protected void Page_Load(object sender, EventArgs e)
    > | > | > | > > {
    > | > | > | > > MembershipUser user = Membership.GetUser();
    > | > | > | > >
    > | > | > | > > Response.Write("<br>Username: " + user.UserName);
    > | > | > | > > Response.Write("<br>:LastLoginDate " +
    > | > user.LastLoginDate);
    > | > | > | > > Response.Write("<br>ProviderUserKey: " +
    > | > | > | > > user.ProviderUserKey.ToString());
    > | > | > | > > }
    > | > | > | > > ================
    > | > | > | > >
    > | > | > | > > the above code help display the current login user's
    > | > ProviderUserKey.
    > | > | >
    > | > | > | > > However, the "ProviderUserKey contains the underlying user
    > key
    > | > | > identity
    > | > | > | > > which is provider specific(generally it should be transparent
    > to
    > | > | > | > > developers...). So we do not recommend that we directly use
    > it in
    > | > our
    > | > | > | > > asp.net web application. Also, for FormsAuthentication, the
    > | > | > authentication
    > | > | > | > > ticket is cookie based, and I think the authentication
    > ticket
    > | > only
    > | > | > | > > contains username as the identity rather than the underlying
    > | > UserKey.
    > | > | > | > > Is there any particular scenario in your application that you
    > | > need to
    > | > | > use
    > | > | > | > > the underlying Provider specific UserKey value? Please feel
     
    TdarTdar, Nov 15, 2005
    #11
  12. RE: getting Membership userid to use and store in a custom databas

    Hi Tdar,

    Thanks for your further followup.
    After viewing the code you provided and performing some tests on ourside,
    here are some of my suggestions on this:

    1. As for the ASP.NET Profiles, it is user specific, so please make sure
    when you update the Profile , the current user has actually login the web
    site. In other word, the current user is not under anonymous status. (We
    can enable anonymousIdentify so as to enable anonymous user for profile
    services....)

    2. If #1 is ok. Then, we should make sure that each time after we set new
    values on user's profile, we have actually update the Profile values into
    the underlying persistent store (database....). Though we can set the
    Profile service to update Automatically as below:

    <system.web>
    <profile enabled="true" automaticSaveEnabled="true" >

    this only works when our page is normally ends, there is no other code
    which end the page request in the middle. And in your code you use
    Response.Redirect, it may cause the Profile values haven't been updated to
    db, so to make sure this, I suggest you call the "Profile.Save()" before
    you call Response.Redirect, like below:

    =========
    Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e As
    System.EventArgs)
    'Profile.PreferredBackgroundColor =
    Color.FromName(ddlColor.SelectedValue)
    Profile.dbman_id_letter = dbmanletter.Text
    Profile.dbman_user_password = dbmancode.Text

    Profile.Save()


    Response.Redirect(Request.Url.LocalPath)
    End Sub
    =========

    This works well on my side. BTW, as for System.Drawing.Color, you need to
    reference the System.Drawing.dll in your web application first, then we can
    access the System.Drawing Namespace.... Also, we can define the Color
    propety in profile like:

    <group name="Favorite" >
    <add name="Color" type="System.Drawing.Color"
    serializeAs="Binary"/>
    .................


    In addition, to use CustomClass in Profile, we can just define a custom
    class(better to make it as [Serializable]) and deinfe it in profile like;

    <add name="MyUnit" readOnly="false" type="CustomProfileClasses.MyUnit"
    serializeAs="Binary"/>

    =======code for custom class=====
    [Serializable]
    public class MyUnit
    {
    public string Name = string.Empty;
    public int Count =0;
    public bool Enabled = false;
    }
    ===============


    Then, we can access the custom class properties in Profile, just as other
    buildin type properteis, e.g:

    Profile.MyUnit.Name = "name"
    Profile.MyUnit.Count = 3


    Hope helps. Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | Thread-Topic: getting Membership userid to use and store in a custom
    databas
    | thread-index: AcXp/zUzrhXhQnO4RrGHcNcjFu+dSg==
    | X-WBNR-Posting-Host: 24.73.223.27
    | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | References: <>
    <>
    <>
    <>
    <Q#Y$>
    <>
    <>
    <>
    <2Fd#>
    | Subject: RE: getting Membership userid to use and store in a custom
    databas
    | Date: Tue, 15 Nov 2005 08:11:16 -0800
    | Lines: 376
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:31150
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | Hello,
    | Ok I have been this profile stuff somewhat working,
    | however it is not saving the profile info for each user right here is the
    | record of the two differnt users from the asp_profile table:
    | record 1 shippingtest user
    | {AF8020C2-4D36-47EE-B4EE-4D42AE080FD0}
    | PreferredBackgroundColor:B:0:187:<Binary> 11/15/2005 3:57:22 PM
    | record 2 djp user
    |
    {8DFE1B7D-2637-4DB8-862C-296F277BA77E}dbman_id_letter:S:0:1:preferredBackgro
    undColor:B:0:187:dbman_user_password:S:1:4: QDP99 <Binary> 11/15/2005
    | 3:55:20 PM
    |
    | the page code is : ( i do use master pages)
    |
    | Enter your preferred background color:
    | <asp:DropDownList ID="ddlColor" runat="server">
    | <asp:ListItem>Aqua</asp:ListItem>
    | </asp:DropDownList><br />
    | <br />
    | Enter your dbman email letter(case sensitive):<br />
    | <asp:TextBox ID="dbmanletter" runat="server"></asp:TextBox><br />
    | <br />
    | Enter your dbman sales code:<br />
    | <asp:TextBox ID="dbmancode" runat="server"></asp:TextBox><br />
    | <br />
    | <asp:button id="btnUpdatePreferences" runat="server"
    text="Click
    | to update your profile" onclick="btnUpdatePreferences_Click" />
    | <br />
    |
    | The code behind is:
    |
    | Partial Class MyProfile
    | Inherits System.Web.UI.Page
    |
    | Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e As
    | System.EventArgs)
    | 'Profile.PreferredBackgroundColor =
    | Color.FromName(ddlColor.SelectedValue)
    | Profile.dbman_id_letter = dbmanletter.Text
    | Profile.dbman_user_password = dbmancode.Text
    | Response.Redirect(Request.Url.LocalPath)
    | End Sub
    |
    | Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    | System.EventArgs) Handles Me.Load
    | dbmancode.Text = Profile.dbman_user_password
    | dbmanletter.Text = Profile.dbman_id_letter
    | End Sub
    | End Class
    |
    | I commented out this time because i am not sure yet and have not
    researched
    | yet how to put system.drawing in a code behind page thus i commented out
    | that line
    | 'Profile.PreferredBackgroundColor =
    Color.FromName(ddlColor.SelectedValue)
    |
    | for the djp user the stuff works file, but for the other shiptest users
    the
    | dbman letter and dbman code do not save
    |
    | I really hope you expand on this prfile area in the future because I dont
    | see it being a viable for storeing a customers multiple shipping address
    | (unless it is because i have nto played with the seralization yet) and
    then
    | for creating reports such as mailing list using there address i see there
    has
    | to be alot of extra work splitting up the fields to pull the data
    directly
    | from the database for say a crystal report..
    |
    | Tdar
    |
    |
    |
    |
    |
    |
    |
    |
    |
    | "Steven Cheng[MSFT]" wrote:
    |
    | > Thanks for your response Tdar,
    | >
    | > As for the profile service, it can be configured to use any different
    | > underlying data strorage as long as there is proper provider for it(By
    | > default we use Sql data store). And of course we can store mutliple
    lists
    | > or other class instance or objects in the profile db for each user ,
    the
    | > requirement is that those class must be serializable (since it'll be
    | > serialized before persisted into profile db...).
    | >
    | > Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | > --------------------
    | > | Thread-Topic: getting Membership userid to use and store in a custom
    | > databas
    | > | thread-index: AcXkbmloXup2uoowQ5Kem787opk45A==
    | > | X-WBNR-Posting-Host: 65.35.95.187
    | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | References: <>
    | > <>
    | > <>
    | > <>
    | > <Q#Y$>
    | > <>
    | > <>
    | > | Subject: RE: getting Membership userid to use and store in a custom
    | > databas
    | > | Date: Tue, 8 Nov 2005 06:12:11 -0800
    | > | Lines: 301
    | > | Message-ID: <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain;
    | > | charset="Utf-8"
    | > | Content-Transfer-Encoding: 7bit
    | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | Content-Class: urn:content-classes:message
    | > | Importance: normal
    | > | Priority: normal
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet.webcontrols:11763
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > |
    | > | Ok cool, was looking at it and only one question I can think of is
    say
    | > | besides the shipping cart items, can i store more then one many item
    | > list,
    | > | say one list is shopping cart items and antother for say a list of
    items
    | > they
    | > | are interested in. or even another for list of websites they like. OR
    | > | mutliple shipping address, or well etc etc for that user.
    | > |
    | > | I am going to assume this is yes, because you all are very talented.
    | > |
    | > |
    | > | "Steven Cheng[MSFT]" wrote:
    | > |
    | > | > Hi Tdar,
    | > | >
    | > | > As for the ID , it is used internally by the ServiceProvider which
    may
    | > not
    | > | > expose public interfaces for us to query data through that UserKey.
    So
    | > | > what's the information you want to get through this userkey?
    | > | > In your former message, you mentioned that
    | > | > ===================
    | > | >
    | > | > I would like to use the key in a many to one database the (one
    being
    | > your
    | > | > memebership database, many being favorate items for that user) for
    | > there
    | > | > custom home page. In order to accomplish this I would need the
    userid
    | > | > (unique key) that i can populate as a relationship between the two
    SQL
    | > | > tables. And I would need to query for that information in that
    table
    | > after
    | > | > words.
    | > | >
    | > | > =================
    | > | >
    | > | > If I understand well, what you'd like to do is something like the
    | > Profile
    | > | > service in ASP.NET 2.0. The Profile service can help store
    personal
    | > datas
    | > | > (specific to a certain user) so that we can provide some
    customizable
    | > datas
    | > | > for users( can work together with MembershipService...) Have you
    tried
    | > the
    | > | > Profile service to see if it meet your requirement?
    | > | >
    | > | > Here are some related reference on ASP.NET 2.0's profile service:
    | > | >
    | > | > #ASP.NET Profile Properties Overview
    | > | > http://msdn2.microsoft.com/en-us/library/2y3fs9xs.aspx
    | > | >
    | > | > #Storing User Profiles
    | > | > http://www.asp.net/QUICKSTART/aspnet/doc/profile/default.aspx#schema
    | > | >
    | > | > #Storing User Information with ASP.NET 2.0 Profiles
    | > | >
    | >
    http://msdn.microsoft.com/library/en-us/dnvs05/html/userprofiles.asp?frame=t
    | > | > rue
    | > | >
    | > | > Hope helps. Thanks,
    | > | >
    | > | > Steven Cheng
    | > | > Microsoft Online Support
    | > | >
    | > | > Get Secure! www.microsoft.com/security
    | > | > (This posting is provided "AS IS", with no warranties, and confers
    no
    | > | > rights.)
    | > | >
    | > | >
    | > | >
    | > | >
    | > | >
    | > | >
    | > | > --------------------
    | > | > | Thread-Topic: getting Membership userid to use and store in a
    custom
    | > | > databas
    | > | > | thread-index: AcXkG7DvAqUyrXRVTSWGiRQq1SEVWw==
    | > | > | X-WBNR-Posting-Host: 65.35.95.187
    | > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | > | References: <>
    | > | > <>
    | > | > <>
    | > | > <>
    | > | > <Q#Y$>
    | > | > | Subject: RE: getting Membership userid to use and store in a
    custom
    | > | > databas
    | > | > | Date: Mon, 7 Nov 2005 20:20:03 -0800
    | > | > | Lines: 184
    | > | > | Message-ID: <>
    | > | > | MIME-Version: 1.0
    | > | > | Content-Type: text/plain;
    | > | > | charset="Utf-8"
    | > | > | Content-Transfer-Encoding: 7bit
    | > | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | > | Content-Class: urn:content-classes:message
    | > | > | Importance: normal
    | > | > | Priority: normal
    | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > | > microsoft.public.dotnet.framework.aspnet.webcontrols:11753
    | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > |
    | > | > | I am wondering how i could use that in when configuring the data
    | > | > connection.
    | > | > | should i just throw the userid in a hidden text box and they use
    the
    | > | > control
    | > | > | function in the configure dataconnection to do a where query on
    that
    | > user
    | > | > id,
    | > | > | or is there a better easier way to do that ??
    | > | > |
    | > | > |
    | > | > |
    | > | > | "Steven Cheng[MSFT]" wrote:
    | > | > |
    | > | > | > Hi Tdar,
    | > | > | >
    | > | > | > Glad that you've fot it working. Also, it's my pleasure to be
    of
    | > | > | > assistance. If there're any further things we can help, please
    feel
    | > | > free to
    | > | > | > post here.
    | > | > | >
    | > | > | > Thanks,
    | > | > | >
    | > | > | > Steven Cheng
    | > | > | > Microsoft Online Support
    | > | > | >
    | > | > | > Get Secure! www.microsoft.com/security
    | > | > | > (This posting is provided "AS IS", with no warranties, and
    confers
    | > no
    | > | > | > rights.)
    | > | > | >
    | > | > | >
    | > | > | > --------------------
    | > | > | > | Thread-Topic: getting Membership userid to use and store in a
    | > custom
    | > | > | > databas
    | > | > | > | thread-index: AcXjrk2hkYaS5LRoRZWhNEOKedvxLw==
    | > | > | > | X-WBNR-Posting-Host: 24.73.223.27
    | > | > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | > | > | References:
    <>
    | > | > | > <>
    | > | > | > <>
    | > | > | > | Subject: RE: getting Membership userid to use and store in a
    | > custom
    | > | > | > databas
    | > | > | > | Date: Mon, 7 Nov 2005 07:17:01 -0800
    | > | > | > | Lines: 109
    | > | > | > | Message-ID:
    <>
    | > | > | > | MIME-Version: 1.0
    | > | > | > | Content-Type: text/plain;
    | > | > | > | charset="Utf-8"
    | > | > | > | Content-Transfer-Encoding: 7bit
    | > | > | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | > | > | Content-Class: urn:content-classes:message
    | > | > | > | Importance: normal
    | > | > | > | Priority: normal
    | > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | > | > | Newsgroups:
    microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | > | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > | > | > microsoft.public.dotnet.framework.aspnet.webcontrols:11743
    | > | > | > | X-Tomcat-NG:
    microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | > | > |
    | > | > | > | Sorry,
    | > | > | > | I accually know how to convert it to VB now
    | > | > | > |
    | > | > | > | Dim UserInfo as MembershipUser
    | > | > | > |
    | > | > | > | Finally understand all this :)
    | > | > | > |
    | > | > | > | Tdar
    | > | > | > |
    | > | > | > | "TdarTdar" wrote:
    | > | > | > |
    | > | > | > | > I would like to use the key in a many to one database the
    (one
    | > | > being
    | > | > | > your
    | > | > | > | > memebership database, many being favorate items for that
    user)
    | > for
    | > | > | > there
    | > | > | > | > custom home page. In order to accomplish this I would need
    the
    | > | > userid
    | > | > | > | > (unique key) that i can populate as a relationship between
    the
    | > two
    | > | > SQL
    | > | > | > | > tables. And I would need to query for that information in
    that
    | > | > table
    | > | > | > after
    | > | > | > | > words.
    | > | > | > | >
    | > | > | > | > Tdar
    | > | > | > | >
    | > | > | > | > "Steven Cheng[MSFT]" wrote:
    | > | > | > | >
    | > | > | > | > > Hi Tdar,
    | > | > | > | > >
    | > | > | > | > > Welcome to ASPNET newsgroup.
    | > | > | > | > > Regarding on the getting Membership userid question, do
    you
    | > mean
    | > | > how
    | > | > | > to
    | > | > | > | > > access the underlying MembershipUser's identity
    value(primary
    | > | > key)?
    | > | > | > Based
    | > | > | > | > > on my understanding, we can get the MembershipUser's
    | > underlying
    | > | > | > database
    | > | > | > | > > identity through the following code:
    | > | > | > | > >
    | > | > | > | > > ================
    | > | > | > | > > protected void Page_Load(object sender, EventArgs e)
    | > | > | > | > > {
    | > | > | > | > > MembershipUser user = Membership.GetUser();
    | > | > | > | > >
    | > | > | > | > > Response.Write("<br>Username: " + user.UserName);
    | > | > | > | > > Response.Write("<br>:LastLoginDate " +
    | > | > user.LastLoginDate);
    | > | > | > | > > Response.Write("<br>ProviderUserKey: " +
    | > | > | > | > > user.ProviderUserKey.ToString());
    | > | > | > | > > }
    | > | > | > | > > ================
    | > | > | > | > >
    | > | > | > | > > the above code help display the current login user's
    | > | > ProviderUserKey.
    | > | > | >
    | > | > | > | > > However, the "ProviderUserKey contains the underlying
    user
    | > key
    | > | > | > identity
    | > | > | > | > > which is provider specific(generally it should be
    transparent
    | > to
    | > | > | > | > > developers...). So we do not recommend that we directly
    use
    | > it in
    | > | > our
    | > | > | > | > > asp.net web application. Also, for FormsAuthentication,
    the
    | > | > | > authentication
    | > | > | > | > > ticket is cookie based, and I think the authentication
    | > ticket
    | > | > only
    | > | > | > | > > contains username as the identity rather than the
    underlying
    | > | > UserKey.
    | > | > | > | > > Is there any particular scenario in your application that
    you
    | > | > need to
    | > | > | > use
    | > | > | > | > > the underlying Provider specific UserKey value? Please
    feel
    |
     
    Steven Cheng[MSFT], Nov 17, 2005
    #12
  13. RE: getting Membership userid to use and store in a custom databas

    Hi Tdar,

    Does the information in my last reply helps you on the new problem? If
    there're anything else we can help, please feel free to post here.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | X-Tomcat-ID: 295933607
    | References: <>
    <>
    <>
    <>
    <Q#Y$>
    <>
    <>
    <>
    <2Fd#>
    <>
    | MIME-Version: 1.0
    | Content-Type: text/plain
    | Content-Transfer-Encoding: 7bit
    | From: (Steven Cheng[MSFT])
    | Organization: Microsoft
    | Date: Thu, 17 Nov 2005 13:30:27 GMT
    | Subject: RE: getting Membership userid to use and store in a custom
    databas
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | Lines: 491
    | Path: TK2MSFTNGXA02.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:31192
    | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
    |
    | Hi Tdar,
    |
    | Thanks for your further followup.
    | After viewing the code you provided and performing some tests on ourside,
    | here are some of my suggestions on this:
    |
    | 1. As for the ASP.NET Profiles, it is user specific, so please make sure
    | when you update the Profile , the current user has actually login the web
    | site. In other word, the current user is not under anonymous status. (We
    | can enable anonymousIdentify so as to enable anonymous user for profile
    | services....)
    |
    | 2. If #1 is ok. Then, we should make sure that each time after we set new
    | values on user's profile, we have actually update the Profile values into
    | the underlying persistent store (database....). Though we can set the
    | Profile service to update Automatically as below:
    |
    | <system.web>
    | <profile enabled="true" automaticSaveEnabled="true" >
    |
    | this only works when our page is normally ends, there is no other code
    | which end the page request in the middle. And in your code you use
    | Response.Redirect, it may cause the Profile values haven't been updated
    to
    | db, so to make sure this, I suggest you call the "Profile.Save()" before
    | you call Response.Redirect, like below:
    |
    | =========
    | Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e As
    | System.EventArgs)
    | 'Profile.PreferredBackgroundColor =
    | Color.FromName(ddlColor.SelectedValue)
    | Profile.dbman_id_letter = dbmanletter.Text
    | Profile.dbman_user_password = dbmancode.Text
    |
    | Profile.Save()
    |
    |
    | Response.Redirect(Request.Url.LocalPath)
    | End Sub
    | =========
    |
    | This works well on my side. BTW, as for System.Drawing.Color, you need to
    | reference the System.Drawing.dll in your web application first, then we
    can
    | access the System.Drawing Namespace.... Also, we can define the Color
    | propety in profile like:
    |
    | <group name="Favorite" >
    | <add name="Color" type="System.Drawing.Color"
    | serializeAs="Binary"/>
    | ................
    |
    |
    | In addition, to use CustomClass in Profile, we can just define a custom
    | class(better to make it as [Serializable]) and deinfe it in profile like;
    |
    | <add name="MyUnit" readOnly="false" type="CustomProfileClasses.MyUnit"
    | serializeAs="Binary"/>
    |
    | =======code for custom class=====
    | [Serializable]
    | public class MyUnit
    | {
    | public string Name = string.Empty;
    | public int Count =0;
    | public bool Enabled = false;
    | }
    | ===============
    |
    |
    | Then, we can access the custom class properties in Profile, just as other
    | buildin type properteis, e.g:
    |
    | Profile.MyUnit.Name = "name"
    | Profile.MyUnit.Count = 3
    |
    |
    | Hope helps. Thanks,
    |
    | Steven Cheng
    | Microsoft Online Support
    |
    | Get Secure! www.microsoft.com/security
    | (This posting is provided "AS IS", with no warranties, and confers no
    | rights.)
    | --------------------
    | | Thread-Topic: getting Membership userid to use and store in a custom
    | databas
    | | thread-index: AcXp/zUzrhXhQnO4RrGHcNcjFu+dSg==
    | | X-WBNR-Posting-Host: 24.73.223.27
    | | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | | References: <>
    | <>
    | <>
    | <>
    | <Q#Y$>
    | <>
    | <>
    | <>
    | <2Fd#>
    | | Subject: RE: getting Membership userid to use and store in a custom
    | databas
    | | Date: Tue, 15 Nov 2005 08:11:16 -0800
    | | Lines: 376
    | | Message-ID: <>
    | | MIME-Version: 1.0
    | | Content-Type: text/plain;
    | | charset="Utf-8"
    | | Content-Transfer-Encoding: 7bit
    | | X-Newsreader: Microsoft CDO for Windows 2000
    | | Content-Class: urn:content-classes:message
    | | Importance: normal
    | | Priority: normal
    | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | | Xref: TK2MSFTNGXA02.phx.gbl
    | microsoft.public.dotnet.framework.aspnet.webcontrols:31150
    | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | |
    | | Hello,
    | | Ok I have been this profile stuff somewhat working,
    | | however it is not saving the profile info for each user right here is
    the
    | | record of the two differnt users from the asp_profile table:
    | | record 1 shippingtest user
    | | {AF8020C2-4D36-47EE-B4EE-4D42AE080FD0}
    | | PreferredBackgroundColor:B:0:187:<Binary> 11/15/2005 3:57:22 PM
    | | record 2 djp user
    | |
    |
    {8DFE1B7D-2637-4DB8-862C-296F277BA77E}dbman_id_letter:S:0:1:preferredBackgro
    | undColor:B:0:187:dbman_user_password:S:1:4: QDP99 <Binary> 11/15/2005
    | | 3:55:20 PM
    | |
    | | the page code is : ( i do use master pages)
    | |
    | | Enter your preferred background color:
    | | <asp:DropDownList ID="ddlColor" runat="server">
    | | <asp:ListItem>Aqua</asp:ListItem>
    | | </asp:DropDownList><br />
    | | <br />
    | | Enter your dbman email letter(case sensitive):<br />
    | | <asp:TextBox ID="dbmanletter" runat="server"></asp:TextBox><br />
    | | <br />
    | | Enter your dbman sales code:<br />
    | | <asp:TextBox ID="dbmancode" runat="server"></asp:TextBox><br />
    | | <br />
    | | <asp:button id="btnUpdatePreferences" runat="server"
    | text="Click
    | | to update your profile" onclick="btnUpdatePreferences_Click" />
    | | <br />
    | |
    | | The code behind is:
    | |
    | | Partial Class MyProfile
    | | Inherits System.Web.UI.Page
    | |
    | | Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e As
    | | System.EventArgs)
    | | 'Profile.PreferredBackgroundColor =
    | | Color.FromName(ddlColor.SelectedValue)
    | | Profile.dbman_id_letter = dbmanletter.Text
    | | Profile.dbman_user_password = dbmancode.Text
    | | Response.Redirect(Request.Url.LocalPath)
    | | End Sub
    | |
    | | Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    | | System.EventArgs) Handles Me.Load
    | | dbmancode.Text = Profile.dbman_user_password
    | | dbmanletter.Text = Profile.dbman_id_letter
    | | End Sub
    | | End Class
    | |
    | | I commented out this time because i am not sure yet and have not
    | researched
    | | yet how to put system.drawing in a code behind page thus i commented
    out
    | | that line
    | | 'Profile.PreferredBackgroundColor =
    | Color.FromName(ddlColor.SelectedValue)
    | |
    | | for the djp user the stuff works file, but for the other shiptest users
    | the
    | | dbman letter and dbman code do not save
    | |
    | | I really hope you expand on this prfile area in the future because I
    dont
    | | see it being a viable for storeing a customers multiple shipping
    address
    | | (unless it is because i have nto played with the seralization yet) and
    | then
    | | for creating reports such as mailing list using there address i see
    there
    | has
    | | to be alot of extra work splitting up the fields to pull the data
    | directly
    | | from the database for say a crystal report..
    | |
    | | Tdar
    | |
    | |
    | |
    | |
    | |
    | |
    | |
    | |
    | |
    | | "Steven Cheng[MSFT]" wrote:
    | |
    | | > Thanks for your response Tdar,
    | | >
    | | > As for the profile service, it can be configured to use any different
    | | > underlying data strorage as long as there is proper provider for
    it(By
    | | > default we use Sql data store). And of course we can store mutliple
    | lists
    | | > or other class instance or objects in the profile db for each user ,
    | the
    | | > requirement is that those class must be serializable (since it'll be
    | | > serialized before persisted into profile db...).
    | | >
    | | > Thanks,
    | | >
    | | > Steven Cheng
    | | > Microsoft Online Support
    | | >
    | | > Get Secure! www.microsoft.com/security
    | | > (This posting is provided "AS IS", with no warranties, and confers no
    | | > rights.)
    | | >
    | | >
    | | > --------------------
    | | > | Thread-Topic: getting Membership userid to use and store in a
    custom
    | | > databas
    | | > | thread-index: AcXkbmloXup2uoowQ5Kem787opk45A==
    | | > | X-WBNR-Posting-Host: 65.35.95.187
    | | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | | > | References: <>
    | | > <>
    | | > <>
    | | > <>
    | | > <Q#Y$>
    | | > <>
    | | > <>
    | | > | Subject: RE: getting Membership userid to use and store in a custom
    | | > databas
    | | > | Date: Tue, 8 Nov 2005 06:12:11 -0800
    | | > | Lines: 301
    | | > | Message-ID: <>
    | | > | MIME-Version: 1.0
    | | > | Content-Type: text/plain;
    | | > | charset="Utf-8"
    | | > | Content-Transfer-Encoding: 7bit
    | | > | X-Newsreader: Microsoft CDO for Windows 2000
    | | > | Content-Class: urn:content-classes:message
    | | > | Importance: normal
    | | > | Priority: normal
    | | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | | > | Xref: TK2MSFTNGXA01.phx.gbl
    | | > microsoft.public.dotnet.framework.aspnet.webcontrols:11763
    | | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | | > |
    | | > | Ok cool, was looking at it and only one question I can think of is
    | say
    | | > | besides the shipping cart items, can i store more then one many
    item
    | | > list,
    | | > | say one list is shopping cart items and antother for say a list of
    | items
    | | > they
    | | > | are interested in. or even another for list of websites they like.
    OR
    | | > | mutliple shipping address, or well etc etc for that user.
    | | > |
    | | > | I am going to assume this is yes, because you all are very
    talented.
    | | > |
    | | > |
    | | > | "Steven Cheng[MSFT]" wrote:
    | | > |
    | | > | > Hi Tdar,
    | | > | >
    | | > | > As for the ID , it is used internally by the ServiceProvider
    which
    | may
    | | > not
    | | > | > expose public interfaces for us to query data through that
    UserKey.
    | So
    | | > | > what's the information you want to get through this userkey?
    | | > | > In your former message, you mentioned that
    | | > | > ===================
    | | > | >
    | | > | > I would like to use the key in a many to one database the (one
    | being
    | | > your
    | | > | > memebership database, many being favorate items for that user)
    for
    | | > there
    | | > | > custom home page. In order to accomplish this I would need the
    | userid
    | | > | > (unique key) that i can populate as a relationship between the
    two
    | SQL
    | | > | > tables. And I would need to query for that information in that
    | table
    | | > after
    | | > | > words.
    | | > | >
    | | > | > =================
    | | > | >
    | | > | > If I understand well, what you'd like to do is something like the
    | | > Profile
    | | > | > service in ASP.NET 2.0. The Profile service can help store
    | personal
    | | > datas
    | | > | > (specific to a certain user) so that we can provide some
    | customizable
    | | > datas
    | | > | > for users( can work together with MembershipService...) Have you
    | tried
    | | > the
    | | > | > Profile service to see if it meet your requirement?
    | | > | >
    | | > | > Here are some related reference on ASP.NET 2.0's profile service:
    | | > | >
    | | > | > #ASP.NET Profile Properties Overview
    | | > | > http://msdn2.microsoft.com/en-us/library/2y3fs9xs.aspx
    | | > | >
    | | > | > #Storing User Profiles
    | | > | >
    http://www.asp.net/QUICKSTART/aspnet/doc/profile/default.aspx#schema
    | | > | >
    | | > | > #Storing User Information with ASP.NET 2.0 Profiles
    | | > | >
    | | >
    |
    http://msdn.microsoft.com/library/en-us/dnvs05/html/userprofiles.asp?frame=t
    | | > | > rue
    | | > | >
    | | > | > Hope helps. Thanks,
    | | > | >
    | | > | > Steven Cheng
    | | > | > Microsoft Online Support
    | | > | >
    | | > | > Get Secure! www.microsoft.com/security
    | | > | > (This posting is provided "AS IS", with no warranties, and
    confers
    | no
    | | > | > rights.)
    | | > | >
    | | > | >
    | | > | >
    | | > | >
    | | > | >
    | | > | >
    | | > | > --------------------
    | | > | > | Thread-Topic: getting Membership userid to use and store in a
    | custom
    | | > | > databas
    | | > | > | thread-index: AcXkG7DvAqUyrXRVTSWGiRQq1SEVWw==
    | | > | > | X-WBNR-Posting-Host: 65.35.95.187
    | | > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | | > | > | References:
    <>
    | | > | > <>
    | | > | > <>
    | | > | > <>
    | | > | > <Q#Y$>
    | | > | > | Subject: RE: getting Membership userid to use and store in a
    | custom
    | | > | > databas
    | | > | > | Date: Mon, 7 Nov 2005 20:20:03 -0800
    | | > | > | Lines: 184
    | | > | > | Message-ID: <>
    | | > | > | MIME-Version: 1.0
    | | > | > | Content-Type: text/plain;
    | | > | > | charset="Utf-8"
    | | > | > | Content-Transfer-Encoding: 7bit
    | | > | > | X-Newsreader: Microsoft CDO for Windows 2000
    | | > | > | Content-Class: urn:content-classes:message
    | | > | > | Importance: normal
    | | > | > | Priority: normal
    | | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | | > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | | > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | | > | > | Xref: TK2MSFTNGXA01.phx.gbl
    | | > | > microsoft.public.dotnet.framework.aspnet.webcontrols:11753
    | | > | > | X-Tomcat-NG:
    microsoft.public.dotnet.framework.aspnet.webcontrols
    | | > | > |
    | | > | > | I am wondering how i could use that in when configuring the
    data
    | | > | > connection.
    | | > | > | should i just throw the userid in a hidden text box and they
    use
    | the
    | | > | > control
    | | > | > | function in the configure dataconnection to do a where query on
    | that
    | | > user
    | | > | > id,
    | | > | > | or is there a better easier way to do that ??
    | | > | > |
    | | > | > |
    | | > | > |
    | | > | > | "Steven Cheng[MSFT]" wrote:
    | | > | > |
    | | > | > | > Hi Tdar,
    | | > | > | >
    | | > | > | > Glad that you've fot it working. Also, it's my pleasure to be
    | of
    | | > | > | > assistance. If there're any further things we can help,
    please
    | feel
    | | > | > free to
    | | > | > | > post here.
    | | > | > | >
    | | > | > | > Thanks,
    | | > | > | >
    | | > | > | > Steven Cheng
    | | > | > | > Microsoft Online Support
    | | > | > | >
    | | > | > | > Get Secure! www.microsoft.com/security
    | | > | > | > (This posting is provided "AS IS", with no warranties, and
    | confers
    | | > no
    | | > | > | > rights.)
    | | > | > | >
    | | > | > | >
    | | > | > | > --------------------
    | | > | > | > | Thread-Topic: getting Membership userid to use and store in
    a
    | | > custom
    | | > | > | > databas
    | | > | > | > | thread-index: AcXjrk2hkYaS5LRoRZWhNEOKedvxLw==
    | | > | > | > | X-WBNR-Posting-Host: 24.73.223.27
    | | > | > | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | | > | > | > | References:
    | <>
    | | > | > | > <>
    | | > | > | > <>
    | | > | > | > | Subject: RE: getting Membership userid to use and store in
    a
    | | > custom
    | | > | > | > databas
    | | > | > | > | Date: Mon, 7 Nov 2005 07:17:01 -0800
    | | > | > | > | Lines: 109
    | | > | > | > | Message-ID:
    | <>
    | | > | > | > | MIME-Version: 1.0
    | | > | > | > | Content-Type: text/plain;
    | | > | > | > | charset="Utf-8"
    | | > | > | > | Content-Transfer-Encoding: 7bit
    | | > | > | > | X-Newsreader: Microsoft CDO for Windows 2000
    | | > | > | > | Content-Class: urn:content-classes:message
    | | > | > | > | Importance: normal
    | | > | > | > | Priority: normal
    | | > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | | > | > | > | Newsgroups:
    | microsoft.public.dotnet.framework.aspnet.webcontrols
    | | > | > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | | > | > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | | > | > | > | Xref: TK2MSFTNGXA01.phx.gbl
    | | > | > | > microsoft.public.dotnet.framework.aspnet.webcontrols:11743
    | | > | > | > | X-Tomcat-NG:
    | microsoft.public.dotnet.framework.aspnet.webcontrols
    | | > | > | > |
    | | > | > | > | Sorry,
    | | > | > | > | I accually know how to convert it to VB now
    | | > | > | > |
    | | > | > | > | Dim UserInfo as MembershipUser
    | | > | > | > |
    | | > | > | > | Finally understand all this :)
    | | > | > | > |
    | | > | > | > | Tdar
    | | > | > | > |
    | | > | > | > | "TdarTdar" wrote:
    | | > | > | > |
    | | > | > | > | > I would like to use the key in a many to one database the
    | (one
    | | > | > being
    | | > | > | > your
    | | > | > | > | > memebership database, many being favorate items for that
    | user)
    | | > for
    | | > | > | > there
    | | > | > | > | > custom home page. In order to accomplish this I would
    need
    | the
    | | > | > userid
    | | > | > | > | > (unique key) that i can populate as a relationship
    between
    | the
    | | > two
    | | > | > SQL
    | | > | > | > | > tables. And I would need to query for that information
    in
    | that
    | | > | > table
    | | > | > | > after
    | | > | > | > | > words.
    | | > | > | > | >
    | | > | > | > | > Tdar
    | | > | > | > | >
    | | > | > | > | > "Steven Cheng[MSFT]" wrote:
    | | > | > | > | >
    | | > | > | > | > > Hi Tdar,
    | | > | > | > | > >
    | | > | > | > | > > Welcome to ASPNET newsgroup.
    | | > | > | > | > > Regarding on the getting Membership userid question, do
    | you
    | | > mean
    | | > | > how
    | | > | > | > to
    | | > | > | > | > > access the underlying MembershipUser's identity
    | value(primary
    | | > | > key)?
    | | > | > | > Based
    | | > | > | > | > > on my understanding, we can get the MembershipUser's
    | | > underlying
    | | > | > | > database
    | | > | > | > | > > identity through the following code:
    | | > | > | > | > >
    | | > | > | > | > > ================
    | | > | > | > | > > protected void Page_Load(object sender, EventArgs e)
    | | > | > | > | > > {
    | | > | > | > | > > MembershipUser user = Membership.GetUser();
    | | > | > | > | > >
    | | > | > | > | > > Response.Write("<br>Username: " +
    user.UserName);
    | | > | > | > | > > Response.Write("<br>:LastLoginDate " +
    | | > | > user.LastLoginDate);
    | | > | > | > | > > Response.Write("<br>ProviderUserKey: " +
    | | > | > | > | > > user.ProviderUserKey.ToString());
    | | > | > | > | > > }
    | | > | > | > | > > ================
    | | > | > | > | > >
    | | > | > | > | > > the above code help display the current login user's
    | | > | > ProviderUserKey.
    | | > | > | >
    | | > | > | > | > > However, the "ProviderUserKey contains the underlying
    | user
    | | > key
    | | > | > | > identity
    | | > | > | > | > > which is provider specific(generally it should be
    | transparent
    | | > to
    | | > | > | > | > > developers...). So we do not recommend that we directly
    | use
    | | > it in
    | | > | > our
    | | > | > | > | > > asp.net web application. Also, for
    FormsAuthentication,
    | the
    | | > | > | > authentication
    | | > | > | > | > > ticket is cookie based, and I think the authentication
    | | > ticket
    | | > | > only
    | | > | > | > | > > contains username as the identity rather than the
    | underlying
    | | > | > UserKey.
    | | > | > | > | > > Is there any particular scenario in your application
    that
    | you
    | | > | > need to
    | | > | > | > use
    | | > | > | > | > > the underlying Provider specific UserKey value? Please
    | feel
    | |
    |
    |
     
    Steven Cheng[MSFT], Nov 21, 2005
    #13
  14. TdarTdar

    TdarTdar Guest

    RE: getting Membership userid to use and store in a custom databas

    Hello,
    Well I went over everything again and went thru the autosave profile
    example, the only thing I can think that may have been affecting this from
    working right before was i was using a code behind, i decided not to use code
    behind for this page and everything is working as designed. Sorry for the
    delay i have to get away from the pc for a while.. Thanks for your time..

    Tdar


    "Steven Cheng[MSFT]" wrote:

    > Hi Tdar,
    >
    > Does the information in my last reply helps you on the new problem? If
    > there're anything else we can help, please feel free to post here.
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    > --------------------
    > | X-Tomcat-ID: 295933607
    > | References: <>
    > <>
    > <>
    > <>
    > <Q#Y$>
    > <>
    > <>
    > <>
    > <2Fd#>
    > <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain
    > | Content-Transfer-Encoding: 7bit
    > | From: (Steven Cheng[MSFT])
    > | Organization: Microsoft
    > | Date: Thu, 17 Nov 2005 13:30:27 GMT
    > | Subject: RE: getting Membership userid to use and store in a custom
    > databas
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | Message-ID: <>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | Lines: 491
    > | Path: TK2MSFTNGXA02.phx.gbl
    > | Xref: TK2MSFTNGXA02.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webcontrols:31192
    > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
    > |
    > | Hi Tdar,
    > |
    > | Thanks for your further followup.
    > | After viewing the code you provided and performing some tests on ourside,
    > | here are some of my suggestions on this:
    > |
    > | 1. As for the ASP.NET Profiles, it is user specific, so please make sure
    > | when you update the Profile , the current user has actually login the web
    > | site. In other word, the current user is not under anonymous status. (We
    > | can enable anonymousIdentify so as to enable anonymous user for profile
    > | services....)
    > |
    > | 2. If #1 is ok. Then, we should make sure that each time after we set new
    > | values on user's profile, we have actually update the Profile values into
    > | the underlying persistent store (database....). Though we can set the
    > | Profile service to update Automatically as below:
    > |
    > | <system.web>
    > | <profile enabled="true" automaticSaveEnabled="true" >
    > |
    > | this only works when our page is normally ends, there is no other code
    > | which end the page request in the middle. And in your code you use
    > | Response.Redirect, it may cause the Profile values haven't been updated
    > to
    > | db, so to make sure this, I suggest you call the "Profile.Save()" before
    > | you call Response.Redirect, like below:
    > |
    > | =========
    > | Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e As
    > | System.EventArgs)
    > | 'Profile.PreferredBackgroundColor =
    > | Color.FromName(ddlColor.SelectedValue)
    > | Profile.dbman_id_letter = dbmanletter.Text
    > | Profile.dbman_user_password = dbmancode.Text
    > |
    > | Profile.Save()
    > |
    > |
    > | Response.Redirect(Request.Url.LocalPath)
    > | End Sub
    > | =========
    > |
    > | This works well on my side. BTW, as for System.Drawing.Color, you need to
    > | reference the System.Drawing.dll in your web application first, then we
    > can
    > | access the System.Drawing Namespace.... Also, we can define the Color
    > | propety in profile like:
    > |
    > | <group name="Favorite" >
    > | <add name="Color" type="System.Drawing.Color"
    > | serializeAs="Binary"/>
    > | ................
    > |
    > |
    > | In addition, to use CustomClass in Profile, we can just define a custom
    > | class(better to make it as [Serializable]) and deinfe it in profile like;
    > |
    > | <add name="MyUnit" readOnly="false" type="CustomProfileClasses.MyUnit"
    > | serializeAs="Binary"/>
    > |
    > | =======code for custom class=====
    > | [Serializable]
    > | public class MyUnit
    > | {
    > | public string Name = string.Empty;
    > | public int Count =0;
    > | public bool Enabled = false;
    > | }
    > | ===============
    > |
    > |
    > | Then, we can access the custom class properties in Profile, just as other
    > | buildin type properteis, e.g:
    > |
    > | Profile.MyUnit.Name = "name"
    > | Profile.MyUnit.Count = 3
    > |
    > |
    > | Hope helps. Thanks,
    > |
    > | Steven Cheng
    > | Microsoft Online Support
    > |
    > | Get Secure! www.microsoft.com/security
    > | (This posting is provided "AS IS", with no warranties, and confers no
    > | rights.)
    > | --------------------
    > | | Thread-Topic: getting Membership userid to use and store in a custom
    > | databas
    > | | thread-index: AcXp/zUzrhXhQnO4RrGHcNcjFu+dSg==
    > | | X-WBNR-Posting-Host: 24.73.223.27
    > | | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | | References: <>
    > | <>
    > | <>
    > | <>
    > | <Q#Y$>
    > | <>
    > | <>
    > | <>
    > | <2Fd#>
    > | | Subject: RE: getting Membership userid to use and store in a custom
    > | databas
    > | | Date: Tue, 15 Nov 2005 08:11:16 -0800
    > | | Lines: 376
    > | | Message-ID: <>
    > | | MIME-Version: 1.0
    > | | Content-Type: text/plain;
    > | | charset="Utf-8"
    > | | Content-Transfer-Encoding: 7bit
    > | | X-Newsreader: Microsoft CDO for Windows 2000
    > | | Content-Class: urn:content-classes:message
    > | | Importance: normal
    > | | Priority: normal
    > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | | Xref: TK2MSFTNGXA02.phx.gbl
    > | microsoft.public.dotnet.framework.aspnet.webcontrols:31150
    > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > | |
    > | | Hello,
    > | | Ok I have been this profile stuff somewhat working,
    > | | however it is not saving the profile info for each user right here is
    > the
    > | | record of the two differnt users from the asp_profile table:
    > | | record 1 shippingtest user
    > | | {AF8020C2-4D36-47EE-B4EE-4D42AE080FD0}
    > | | PreferredBackgroundColor:B:0:187:<Binary> 11/15/2005 3:57:22 PM
    > | | record 2 djp user
    > | |
    > |
    > {8DFE1B7D-2637-4DB8-862C-296F277BA77E}dbman_id_letter:S:0:1:preferredBackgro
    > | undColor:B:0:187:dbman_user_password:S:1:4: QDP99 <Binary> 11/15/2005
    > | | 3:55:20 PM
    > | |
    > | | the page code is : ( i do use master pages)
    > | |
    > | | Enter your preferred background color:
    > | | <asp:DropDownList ID="ddlColor" runat="server">
    > | | <asp:ListItem>Aqua</asp:ListItem>
    > | | </asp:DropDownList><br />
    > | | <br />
    > | | Enter your dbman email letter(case sensitive):<br />
    > | | <asp:TextBox ID="dbmanletter" runat="server"></asp:TextBox><br />
    > | | <br />
    > | | Enter your dbman sales code:<br />
    > | | <asp:TextBox ID="dbmancode" runat="server"></asp:TextBox><br />
    > | | <br />
    > | | <asp:button id="btnUpdatePreferences" runat="server"
    > | text="Click
    > | | to update your profile" onclick="btnUpdatePreferences_Click" />
    > | | <br />
    > | |
    > | | The code behind is:
    > | |
    > | | Partial Class MyProfile
    > | | Inherits System.Web.UI.Page
    > | |
    > | | Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e As
    > | | System.EventArgs)
    > | | 'Profile.PreferredBackgroundColor =
    > | | Color.FromName(ddlColor.SelectedValue)
    > | | Profile.dbman_id_letter = dbmanletter.Text
    > | | Profile.dbman_user_password = dbmancode.Text
    > | | Response.Redirect(Request.Url.LocalPath)
    > | | End Sub
    > | |
    > | | Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    > | | System.EventArgs) Handles Me.Load
    > | | dbmancode.Text = Profile.dbman_user_password
    > | | dbmanletter.Text = Profile.dbman_id_letter
    > | | End Sub
    > | | End Class
    > | |
    > | | I commented out this time because i am not sure yet and have not
    > | researched
    > | | yet how to put system.drawing in a code behind page thus i commented
    > out
    > | | that line
    > | | 'Profile.PreferredBackgroundColor =
    > | Color.FromName(ddlColor.SelectedValue)
    > | |
    > | | for the djp user the stuff works file, but for the other shiptest users
    > | the
    > | | dbman letter and dbman code do not save
    > | |
    > | | I really hope you expand on this prfile area in the future because I
    > dont
    > | | see it being a viable for storeing a customers multiple shipping
    > address
    > | | (unless it is because i have nto played with the seralization yet) and
    > | then
    > | | for creating reports such as mailing list using there address i see
    > there
    > | has
    > | | to be alot of extra work splitting up the fields to pull the data
    > | directly
    > | | from the database for say a crystal report..
    > | |
    > | | Tdar
    > | |
    > | |
    > | |
    > | |
    > | |
    > | |
    > | |
    > | |
    > | |
    > | | "Steven Cheng[MSFT]" wrote:
    > | |
    > | | > Thanks for your response Tdar,
    > | | >
    > | | > As for the profile service, it can be configured to use any different
    > | | > underlying data strorage as long as there is proper provider for
    > it(By
    > | | > default we use Sql data store). And of course we can store mutliple
    > | lists
    > | | > or other class instance or objects in the profile db for each user ,
    > | the
    > | | > requirement is that those class must be serializable (since it'll be
    > | | > serialized before persisted into profile db...).
    > | | >
    > | | > Thanks,
    > | | >
    > | | > Steven Cheng
    > | | > Microsoft Online Support
    > | | >
    > | | > Get Secure! www.microsoft.com/security
    > | | > (This posting is provided "AS IS", with no warranties, and confers no
    > | | > rights.)
    > | | >
    > | | >
    > | | > --------------------
    > | | > | Thread-Topic: getting Membership userid to use and store in a
    > custom
    > | | > databas
    > | | > | thread-index: AcXkbmloXup2uoowQ5Kem787opk45A==
    > | | > | X-WBNR-Posting-Host: 65.35.95.187
    > | | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    > | | > | References: <>
    > | | > <>
    > | | > <>
    > | | > <>
    > | | > <Q#Y$>
    > | | > <>
    > | | > <>
    > | | > | Subject: RE: getting Membership userid to use and store in a custom
    > | | > databas
    > | | > | Date: Tue, 8 Nov 2005 06:12:11 -0800
    > | | > | Lines: 301
    > | | > | Message-ID: <>
    > | | > | MIME-Version: 1.0
    > | | > | Content-Type: text/plain;
    > | | > | charset="Utf-8"
    > | | > | Content-Transfer-Encoding: 7bit
     
    TdarTdar, Nov 21, 2005
    #14
  15. RE: getting Membership userid to use and store in a custom databas

    Thanks for your followup.

    Glad that you've already got it working. And when there is anything else we
    can help, please feel free to post here.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | Thread-Topic: getting Membership userid to use and store in a custom
    databas
    | thread-index: AcXuxLMV7pYe2B0uQjyZ5NKaPo6rGw==
    | X-WBNR-Posting-Host: 24.73.223.27
    | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | References: <>
    <>
    <>
    <>
    <Q#Y$>
    <>
    <>
    <>
    <2Fd#>
    <>
    <>
    <>
    | Subject: RE: getting Membership userid to use and store in a custom
    databas
    | Date: Mon, 21 Nov 2005 09:55:03 -0800
    | Lines: 312
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webcontrols:31244
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    |
    | Hello,
    | Well I went over everything again and went thru the autosave profile
    | example, the only thing I can think that may have been affecting this
    from
    | working right before was i was using a code behind, i decided not to use
    code
    | behind for this page and everything is working as designed. Sorry for the
    | delay i have to get away from the pc for a while.. Thanks for your time..
    |
    | Tdar
    |
    |
    | "Steven Cheng[MSFT]" wrote:
    |
    | > Hi Tdar,
    | >
    | > Does the information in my last reply helps you on the new problem? If
    | > there're anything else we can help, please feel free to post here.
    | >
    | > Regards,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | > --------------------
    | > | X-Tomcat-ID: 295933607
    | > | References: <>
    | > <>
    | > <>
    | > <>
    | > <Q#Y$>
    | > <>
    | > <>
    | > <>
    | > <2Fd#>
    | > <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain
    | > | Content-Transfer-Encoding: 7bit
    | > | From: (Steven Cheng[MSFT])
    | > | Organization: Microsoft
    | > | Date: Thu, 17 Nov 2005 13:30:27 GMT
    | > | Subject: RE: getting Membership userid to use and store in a custom
    | > databas
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | Message-ID: <>
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | Lines: 491
    | > | Path: TK2MSFTNGXA02.phx.gbl
    | > | Xref: TK2MSFTNGXA02.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet.webcontrols:31192
    | > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
    | > |
    | > | Hi Tdar,
    | > |
    | > | Thanks for your further followup.
    | > | After viewing the code you provided and performing some tests on
    ourside,
    | > | here are some of my suggestions on this:
    | > |
    | > | 1. As for the ASP.NET Profiles, it is user specific, so please make
    sure
    | > | when you update the Profile , the current user has actually login the
    web
    | > | site. In other word, the current user is not under anonymous status.
    (We
    | > | can enable anonymousIdentify so as to enable anonymous user for
    profile
    | > | services....)
    | > |
    | > | 2. If #1 is ok. Then, we should make sure that each time after we set
    new
    | > | values on user's profile, we have actually update the Profile values
    into
    | > | the underlying persistent store (database....). Though we can set
    the
    | > | Profile service to update Automatically as below:
    | > |
    | > | <system.web>
    | > | <profile enabled="true" automaticSaveEnabled="true" >
    | > |
    | > | this only works when our page is normally ends, there is no other
    code
    | > | which end the page request in the middle. And in your code you use
    | > | Response.Redirect, it may cause the Profile values haven't been
    updated
    | > to
    | > | db, so to make sure this, I suggest you call the "Profile.Save()"
    before
    | > | you call Response.Redirect, like below:
    | > |
    | > | =========
    | > | Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e As
    | > | System.EventArgs)
    | > | 'Profile.PreferredBackgroundColor =
    | > | Color.FromName(ddlColor.SelectedValue)
    | > | Profile.dbman_id_letter = dbmanletter.Text
    | > | Profile.dbman_user_password = dbmancode.Text
    | > |
    | > | Profile.Save()
    | > |
    | > |
    | > | Response.Redirect(Request.Url.LocalPath)
    | > | End Sub
    | > | =========
    | > |
    | > | This works well on my side. BTW, as for System.Drawing.Color, you
    need to
    | > | reference the System.Drawing.dll in your web application first, then
    we
    | > can
    | > | access the System.Drawing Namespace.... Also, we can define the
    Color
    | > | propety in profile like:
    | > |
    | > | <group name="Favorite" >
    | > | <add name="Color" type="System.Drawing.Color"
    | > | serializeAs="Binary"/>
    | > | ................
    | > |
    | > |
    | > | In addition, to use CustomClass in Profile, we can just define a
    custom
    | > | class(better to make it as [Serializable]) and deinfe it in profile
    like;
    | > |
    | > | <add name="MyUnit" readOnly="false"
    type="CustomProfileClasses.MyUnit"
    | > | serializeAs="Binary"/>
    | > |
    | > | =======code for custom class=====
    | > | [Serializable]
    | > | public class MyUnit
    | > | {
    | > | public string Name = string.Empty;
    | > | public int Count =0;
    | > | public bool Enabled = false;
    | > | }
    | > | ===============
    | > |
    | > |
    | > | Then, we can access the custom class properties in Profile, just as
    other
    | > | buildin type properteis, e.g:
    | > |
    | > | Profile.MyUnit.Name = "name"
    | > | Profile.MyUnit.Count = 3
    | > |
    | > |
    | > | Hope helps. Thanks,
    | > |
    | > | Steven Cheng
    | > | Microsoft Online Support
    | > |
    | > | Get Secure! www.microsoft.com/security
    | > | (This posting is provided "AS IS", with no warranties, and confers no
    | > | rights.)
    | > | --------------------
    | > | | Thread-Topic: getting Membership userid to use and store in a
    custom
    | > | databas
    | > | | thread-index: AcXp/zUzrhXhQnO4RrGHcNcjFu+dSg==
    | > | | X-WBNR-Posting-Host: 24.73.223.27
    | > | | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | | References: <>
    | > | <>
    | > | <>
    | > | <>
    | > | <Q#Y$>
    | > | <>
    | > | <>
    | > | <>
    | > | <2Fd#>
    | > | | Subject: RE: getting Membership userid to use and store in a custom
    | > | databas
    | > | | Date: Tue, 15 Nov 2005 08:11:16 -0800
    | > | | Lines: 376
    | > | | Message-ID: <>
    | > | | MIME-Version: 1.0
    | > | | Content-Type: text/plain;
    | > | | charset="Utf-8"
    | > | | Content-Transfer-Encoding: 7bit
    | > | | X-Newsreader: Microsoft CDO for Windows 2000
    | > | | Content-Class: urn:content-classes:message
    | > | | Importance: normal
    | > | | Priority: normal
    | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | | Path:
    TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | | Xref: TK2MSFTNGXA02.phx.gbl
    | > | microsoft.public.dotnet.framework.aspnet.webcontrols:31150
    | > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    | > | |
    | > | | Hello,
    | > | | Ok I have been this profile stuff somewhat working,
    | > | | however it is not saving the profile info for each user right here
    is
    | > the
    | > | | record of the two differnt users from the asp_profile table:
    | > | | record 1 shippingtest user
    | > | | {AF8020C2-4D36-47EE-B4EE-4D42AE080FD0}
    | > | | PreferredBackgroundColor:B:0:187:<Binary> 11/15/2005 3:57:22 PM
    | > | | record 2 djp user
    | > | |
    | > |
    | >
    {8DFE1B7D-2637-4DB8-862C-296F277BA77E}dbman_id_letter:S:0:1:preferredBackgro
    | > | undColor:B:0:187:dbman_user_password:S:1:4: QDP99 <Binary> 11/15/2005
    | > | | 3:55:20 PM
    | > | |
    | > | | the page code is : ( i do use master pages)
    | > | |
    | > | | Enter your preferred background color:
    | > | | <asp:DropDownList ID="ddlColor" runat="server">
    | > | | <asp:ListItem>Aqua</asp:ListItem>
    | > | | </asp:DropDownList><br />
    | > | | <br />
    | > | | Enter your dbman email letter(case sensitive):<br />
    | > | | <asp:TextBox ID="dbmanletter" runat="server"></asp:TextBox><br
    />
    | > | | <br />
    | > | | Enter your dbman sales code:<br />
    | > | | <asp:TextBox ID="dbmancode" runat="server"></asp:TextBox><br />
    | > | | <br />
    | > | | <asp:button id="btnUpdatePreferences" runat="server"
    | > | text="Click
    | > | | to update your profile" onclick="btnUpdatePreferences_Click" />
    | > | | <br />
    | > | |
    | > | | The code behind is:
    | > | |
    | > | | Partial Class MyProfile
    | > | | Inherits System.Web.UI.Page
    | > | |
    | > | | Sub btnUpdatePreferences_Click(ByVal sender As Object, ByVal e
    As
    | > | | System.EventArgs)
    | > | | 'Profile.PreferredBackgroundColor =
    | > | | Color.FromName(ddlColor.SelectedValue)
    | > | | Profile.dbman_id_letter = dbmanletter.Text
    | > | | Profile.dbman_user_password = dbmancode.Text
    | > | | Response.Redirect(Request.Url.LocalPath)
    | > | | End Sub
    | > | |
    | > | | Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    | > | | System.EventArgs) Handles Me.Load
    | > | | dbmancode.Text = Profile.dbman_user_password
    | > | | dbmanletter.Text = Profile.dbman_id_letter
    | > | | End Sub
    | > | | End Class
    | > | |
    | > | | I commented out this time because i am not sure yet and have not
    | > | researched
    | > | | yet how to put system.drawing in a code behind page thus i
    commented
    | > out
    | > | | that line
    | > | | 'Profile.PreferredBackgroundColor =
    | > | Color.FromName(ddlColor.SelectedValue)
    | > | |
    | > | | for the djp user the stuff works file, but for the other shiptest
    users
    | > | the
    | > | | dbman letter and dbman code do not save
    | > | |
    | > | | I really hope you expand on this prfile area in the future because
    I
    | > dont
    | > | | see it being a viable for storeing a customers multiple shipping
    | > address
    | > | | (unless it is because i have nto played with the seralization yet)
    and
    | > | then
    | > | | for creating reports such as mailing list using there address i see
    | > there
    | > | has
    | > | | to be alot of extra work splitting up the fields to pull the data
    | > | directly
    | > | | from the database for say a crystal report..
    | > | |
    | > | | Tdar
    | > | |
    | > | |
    | > | |
    | > | |
    | > | |
    | > | |
    | > | |
    | > | |
    | > | |
    | > | | "Steven Cheng[MSFT]" wrote:
    | > | |
    | > | | > Thanks for your response Tdar,
    | > | | >
    | > | | > As for the profile service, it can be configured to use any
    different
    | > | | > underlying data strorage as long as there is proper provider for
    | > it(By
    | > | | > default we use Sql data store). And of course we can store
    mutliple
    | > | lists
    | > | | > or other class instance or objects in the profile db for each
    user ,
    | > | the
    | > | | > requirement is that those class must be serializable (since it'll
    be
    | > | | > serialized before persisted into profile db...).
    | > | | >
    | > | | > Thanks,
    | > | | >
    | > | | > Steven Cheng
    | > | | > Microsoft Online Support
    | > | | >
    | > | | > Get Secure! www.microsoft.com/security
    | > | | > (This posting is provided "AS IS", with no warranties, and
    confers no
    | > | | > rights.)
    | > | | >
    | > | | >
    | > | | > --------------------
    | > | | > | Thread-Topic: getting Membership userid to use and store in a
    | > custom
    | > | | > databas
    | > | | > | thread-index: AcXkbmloXup2uoowQ5Kem787opk45A==
    | > | | > | X-WBNR-Posting-Host: 65.35.95.187
    | > | | > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <>
    | > | | > | References:
    <>
    | > | | > <>
    | > | | > <>
    | > | | > <>
    | > | | > <Q#Y$>
    | > | | > <>
    | > | | > <>
    | > | | > | Subject: RE: getting Membership userid to use and store in a
    custom
    | > | | > databas
    | > | | > | Date: Tue, 8 Nov 2005 06:12:11 -0800
    | > | | > | Lines: 301
    | > | | > | Message-ID: <>
    | > | | > | MIME-Version: 1.0
    | > | | > | Content-Type: text/plain;
    | > | | > | charset="Utf-8"
    | > | | > | Content-Transfer-Encoding: 7bit
    |
     
    Steven Cheng[MSFT], Nov 22, 2005
    #15
  16. RE: getting Membership userid to use and store in a custom databas

    Hi

    I was seeing the post and got my attention coz I would like to know how
    to do that.

    My Database has many tables related to mey PersonalData (I can shift it
    to the providers table) and they have forein keys that point to the
    PersonalData table. What I want to know is how to get an ID (UserID or
    whatever) that can connect all the tables together.

    Thanks in advance

    *** Sent via Developersdex http://www.developersdex.com ***
     
    André da Silva Carrilho, Jul 28, 2006
    #16
    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. Replies:
    0
    Views:
    741
  2. Replies:
    3
    Views:
    511
  3. perplexed
    Replies:
    10
    Views:
    913
    Juan T. Llibre
    Jan 28, 2007
  4. mazdotnet
    Replies:
    0
    Views:
    705
    mazdotnet
    Sep 12, 2007
  5. Fernandez

    Where to store UserID/Password

    Fernandez, Jul 29, 2004, in forum: ASP .Net Security
    Replies:
    1
    Views:
    190
    Hernan de Lahitte
    Jul 30, 2004
Loading...

Share This Page