User-1767698477 posted
I would like to understand why when I make a guid from a query string like below, it works. The userID is accepted in Membership.Getuser(userID)
userID = New Guid(Request.QueryString("id"))
'Get information about the user
Dim userInfo As MembershipUser = Membership.GetUser(userID)
If userInfo Is Nothing Then
'Could not find user in database. An altered guid
Label1.Text = "The user account could not be found in the membership database."
Exit Sub
Else
However, when I attempt to do the same thing with a Session variable, it doesn't work.
How can I get this to work?
The error says something about a narrowing conversion....
Dim UserId As Guid = New Guid(Session("Userid"))
'get the membership user one time
Dim MUser As MembershipUser = Membership.GetUser(UserId)
With this code below I get the specified cast is invalid. How is the Session("UserID") stored. Is it a type of uniqueidentifier? Or is it just a string? How can I tell?