How to take userid as input parameter

Last post 07-03-2007 5:44 AM by bpw. 1 replies.

Sort Posts:

  • How to take userid as input parameter

    07-03-2007, 1:32 AM
    • Member
      11 point Member
    • mukeshpgdm
    • Member since 04-18-2007, 4:38 AM
    • Posts 40

     Dear Sir

    I am trying to take the user id who  has logged in .

    Can any tell me how to do this!

    Actually I want to use logged in user id as input parameter  for a table .I want to provide  my user to  access my  database of books and allow user to select books and they can  see their history for books he has already booked earlier.

    Input parameter for my "booked books " are "userid" and 'bookid" and on which "date" user has requested.

    Thanks And regards

    mukesh 

  • Re: How to take userid as input parameter

    07-03-2007, 5:44 AM
    Answer
    • Participant
      1,843 point Participant
    • bpw
    • Member since 09-25-2004, 1:57 AM
    • Warrington, England
    • Posts 401

    You don’t say what language you’re using, but the VB code is below. Use the LoggedIn event, which fires just after the user has been authenticated:

    Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn

        ' Hanging on to the username...
        Dim strUserName As String = Login1.UserName

        ' Getting the user ID (GUID)...
        Dim thisUser As MembershipUser = Membership.GetUser(strUserName)
        Dim thisUserID As Guid = thisUser.ProviderUserKey
    End Sub

    Paul Weston
Page 1 of 1 (2 items)