RE: getting Membership userid to use and store in a custom databas
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Tue, 08 Nov 2005 06:37:01 GMT
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=?=" <Tdar@xxxxxxxxxxxxxx>
| References: <E58FF96B-6338-46C8-8F9F-388A6BAF2262@xxxxxxxxxxxxx>
<40eCR904FHA.3936@xxxxxxxxxxxxxxxxxxxxx>
<046814B3-856E-4548-9E84-E23C676D0E0C@xxxxxxxxxxxxx>
<F0207F1B-014F-4D1C-82DE-40006E155E1E@xxxxxxxxxxxxx>
<Q#Y$CMA5FHA.1144@xxxxxxxxxxxxxxxxxxxxx>
| 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: <9CCA3901-4DBB-46C6-912E-0E57289558AB@xxxxxxxxxxxxx>
| 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=?=" <Tdar@xxxxxxxxxxxxxx>
| > | References: <E58FF96B-6338-46C8-8F9F-388A6BAF2262@xxxxxxxxxxxxx>
| > <40eCR904FHA.3936@xxxxxxxxxxxxxxxxxxxxx>
| > <046814B3-856E-4548-9E84-E23C676D0E0C@xxxxxxxxxxxxx>
| > | 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: <F0207F1B-014F-4D1C-82DE-40006E155E1E@xxxxxxxxxxxxx>
| > | 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=?=" <Tdar@xxxxxxxxxxxxxx>
| > | > > | 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: <E58FF96B-6338-46C8-8F9F-388A6BAF2262@xxxxxxxxxxxxx>
| > | > > | 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
| > | > > |
| > | > > |
| > | > > |
| > | > >
| > | > >
| > |
| >
| >
|
.
- Follow-Ups:
- References:
- RE: getting Membership userid to use and store in a custom database
- From: Steven Cheng[MSFT]
- RE: getting Membership userid to use and store in a custom databas
- From: TdarTdar
- RE: getting Membership userid to use and store in a custom databas
- From: TdarTdar
- RE: getting Membership userid to use and store in a custom databas
- From: Steven Cheng[MSFT]
- RE: getting Membership userid to use and store in a custom databas
- From: TdarTdar
- RE: getting Membership userid to use and store in a custom database
- Prev by Date: RE: Datagrid paging I lose my sort
- Next by Date: RE: Error in DataList test query - aspnet 2.0
- Previous by thread: RE: getting Membership userid to use and store in a custom databas
- Next by thread: RE: getting Membership userid to use and store in a custom databas
- Index(es):
Relevant Pages
|