Posted on: 1/3/2015 12:15:00 AM | Views : 611

I have a place on my site where a random site visitor uses a form to send an email to an authenticated site member.
The authenticated site member's registered email address is available in a textbox with ID of "TxtBxTo"
I want to run some logic depending on whether or not that authenticated site member is in Role "Partner"
The code I am using gives the error "Object reference not set to an instance of an object" , referencing the line in bold below.
Here's the code I have to determine if the site member to whom the email is being sent is in the Role "Parter" (the person submitting the form may or may not be a site member):
<--- some working code here that sends an email to the address in TxtBxTo -->
Dim User As MembershipUser Dim MyUserName As String MyUserName = Membership.GetUserNameByEmail(TxtBxTo.Text) User = Membership.GetUser(MyUserName)
If Roles.IsUse ...

Go to the complete details ...