problems to insert online userid

Last post 10-19-2009 12:18 PM by RichardD. 2 replies.

Sort Posts:

  • problems to insert online userid

    10-15-2009, 10:57 AM
    • Member
      10 point Member
    • asp.41net
    • Member since 08-31-2009, 8:22 PM
    • Posts 129

    hi i need to store the userid of the logged user in another table,

    i got this code

    cmd.Parameters.Add("@userId", Membership.GetUser.ProvideUserKey.ToString())

    but this throws me this error:

    Error 1 'ProvideUserKey' is not a member of 'System.Web.Security.MembershipUser'

    what am i doing wrong?

    thanks



     

  • Re: problems to insert online userid

    10-15-2009, 11:22 AM
    Answer
    • Participant
      1,237 point Participant
    • Ibro
    • Member since 10-08-2008, 2:17 PM
    • Posts 393

     in Pageload even.. Dim membershipuser As MembershipUser = Membership.GetUser() 

     

    on where you want to catch the Userid..

    Dim userid As Guid = Membership.GetUser().ProviderUserKey

     

    cmd.Parameters.Add("@userId", userid)

    does this reply help you? mark as an answer
    Ibro
  • Re: problems to insert online userid

    10-19-2009, 12:18 PM
    Answer
    • Contributor
      2,776 point Contributor
    • RichardD
    • Member since 09-03-2002, 7:43 AM
    • Sussex, UK
    • Posts 364

    The property is ProviderUserKey, not ProvideUserKey. (You're missing the "r" on the end of Provider.)

Page 1 of 1 (3 items)