Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > getting Membership userid to use and store in a custom database

Reply
Thread Tools

getting Membership userid to use and store in a custom database

 
 
TdarTdar
Guest
Posts: n/a
 
      11-05-2005
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


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      11-07-2005
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=?=" <(E-Mail Removed)>
| 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: <(E-Mail Removed)>
| 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.webcontro ls
| 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.webcontro ls:11708
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
|
| 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
|
|
|

 
Reply With Quote
 
 
 
 
TdarTdar
Guest
Posts: n/a
 
      11-07-2005
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=?=" <(E-Mail Removed)>
> | 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: <(E-Mail Removed)>
> | 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.webcontro ls
> | 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.webcontro ls:11708
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> |
> | 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
> |
> |
> |
>
>

 
Reply With Quote
 
TdarTdar
Guest
Posts: n/a
 
      11-07-2005
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=?=" <(E-Mail Removed)>
> | 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: <(E-Mail Removed)>
> | 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.webcontro ls
> | 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.webcontro ls:11708
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> |
> | 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
> |
> |
> |
>
>

 
Reply With Quote
 
TdarTdar
Guest
Posts: n/a
 
      11-07-2005
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=?=" <(E-Mail Removed)>
> > | 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: <(E-Mail Removed)>
> > | 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.webcontro ls
> > | 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.webcontro ls:11708
> > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> > |
> > | 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
> > |
> > |
> > |
> >
> >

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      11-08-2005
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=?=" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
<(E-Mail Removed)>
| 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: <(E-Mail Removed)>
| 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.webcontro ls
| 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.webcontro ls:11743
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
|
| 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=?=" <(E-Mail Removed)>
| > > | 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: <(E-Mail Removed)>
| > > | 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.webcontro ls
| > > | 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.webcontro ls:11708
| > > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
| > > |
| > > | 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
| > > |
| > > |
| > > |
| > >
| > >
|

 
Reply With Quote
 
TdarTdar
Guest
Posts: n/a
 
      11-08-2005
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=?=" <(E-Mail Removed)>
> | References: <(E-Mail Removed)>
> <(E-Mail Removed)>
> <(E-Mail Removed)>
> | 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: <(E-Mail Removed)>
> | 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.webcontro ls
> | 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.webcontro ls:11743
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> |
> | 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=?=" <(E-Mail Removed)>
> | > > | 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: <(E-Mail Removed)>
> | > > | 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.webcontro ls
> | > > | 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.webcontro ls:11708
> | > > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> | > > |
> | > > | 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
> | > > |
> | > > |
> | > > |
> | > >
> | > >
> |
>
>

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      11-08-2005
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...lt.aspx#schema

#Storing User Information with ASP.NET 2.0 Profiles
http://msdn.microsoft.com/library/en...es.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=?=" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
<(E-Mail Removed)>
<(E-Mail Removed)>
<Q#Y$(E-Mail Removed)>
| 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: <(E-Mail Removed)>
| 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.webcontro ls
| 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.webcontro ls:11753
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
|
| 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=?=" <(E-Mail Removed)>
| > | References: <(E-Mail Removed)>
| > <(E-Mail Removed)>
| > <(E-Mail Removed)>
| > | 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: <(E-Mail Removed)>
| > | 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.webcontro ls
| > | 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.webcontro ls:11743
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
| > |
| > | 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=?=" <(E-Mail Removed)>
| > | > > | 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: <(E-Mail Removed)>
| > | > > | 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.webcontro ls
| > | > > | 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.webcontro ls:11708
| > | > > | X-Tomcat-NG:
microsoft.public.dotnet.framework.aspnet.webcontro ls
| > | > > |
| > | > > | 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
| > | > > |
| > | > > |
| > | > > |
| > | > >
| > | > >
| > |
| >
| >
|

 
Reply With Quote
 
TdarTdar
Guest
Posts: n/a
 
      11-08-2005
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...lt.aspx#schema
>
> #Storing User Information with ASP.NET 2.0 Profiles
> http://msdn.microsoft.com/library/en...es.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=?=" <(E-Mail Removed)>
> | References: <(E-Mail Removed)>
> <(E-Mail Removed)>
> <(E-Mail Removed)>
> <(E-Mail Removed)>
> <Q#Y$(E-Mail Removed)>
> | 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: <(E-Mail Removed)>
> | 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.webcontro ls
> | 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.webcontro ls:11753
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> |
> | 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=?=" <(E-Mail Removed)>
> | > | References: <(E-Mail Removed)>
> | > <(E-Mail Removed)>
> | > <(E-Mail Removed)>
> | > | 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: <(E-Mail Removed)>
> | > | 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.webcontro ls
> | > | 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.webcontro ls:11743
> | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> | > |
> | > | 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=?=" <(E-Mail Removed)>
> | > | > > | 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: <(E-Mail Removed)>
> | > | > > | 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.webcontro ls
> | > | > > | 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.webcontro ls:11708
> | > | > > | X-Tomcat-NG:
> microsoft.public.dotnet.framework.aspnet.webcontro ls
> | > | > > |
> | > | > > | 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
> | > | > > |
> | > | > > |
> | > | > > |
> | > | > >
> | > | > >
> | > |
> | >
> | >
> |
>
>

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      11-09-2005
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=?=" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
<(E-Mail Removed)>
<(E-Mail Removed)>
<Q#Y$(E-Mail Removed)>
<(E-Mail Removed)>
<(E-Mail Removed)>
| 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: <(E-Mail Removed)>
| 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.webcontro ls
| 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.webcontro ls:11763
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
|
| 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...lt.aspx#schema
| >
| > #Storing User Information with ASP.NET 2.0 Profiles
| >
http://msdn.microsoft.com/library/en...es.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=?=" <(E-Mail Removed)>
| > | References: <(E-Mail Removed)>
| > <(E-Mail Removed)>
| > <(E-Mail Removed)>
| > <(E-Mail Removed)>
| > <Q#Y$(E-Mail Removed)>
| > | 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: <(E-Mail Removed)>
| > | 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.webcontro ls
| > | 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.webcontro ls:11753
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
| > |
| > | 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=?=" <(E-Mail Removed)>
| > | > | References: <(E-Mail Removed)>
| > | > <(E-Mail Removed)>
| > | > <(E-Mail Removed)>
| > | > | 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: <(E-Mail Removed)>
| > | > | 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.webcontro ls
| > | > | 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.webcontro ls:11743
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
| > | > |
| > | > | 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=?=" <(E-Mail Removed)>
| > | > | > > | 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:
<(E-Mail Removed)>
| > | > | > > | 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.webcontro ls
| > | > | > > | 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.webcontro ls:11708
| > | > | > > | X-Tomcat-NG:
| > microsoft.public.dotnet.framework.aspnet.webcontro ls
| > | > | > > |
| > | > | > > | 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
| > | > | > > |
| > | > | > > |
| > | > | > > |
| > | > | > >
| > | > | > >
| > | > |
| > | >
| > | >
| > |
| >
| >
|

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET MemberShip getting user info by UserId mazdotnet ASP .Net 0 09-12-2007 02:50 AM
Accessing membership UserId programmatically? perplexed ASP .Net 10 01-28-2007 10:48 PM
Why no UserID property in the Membership class? ILaughLouder@gmail.com ASP .Net 3 08-16-2006 06:48 PM
getting the membership userid from username when anonymous? neilmcguigan@gmail.com ASP .Net 0 05-28-2006 07:19 AM
Where to store UserID/Password Fernandez ASP .Net Security 1 07-30-2004 04:04 PM



Advertisments