System.NullReferenceException: Object reference not set to an instance of an object.

Topics: Developer Discussion, Help
Jun 19, 2007 at 10:39 AM
Hi,
Im trying to use the admin section to send out emails to registered users, im using the code that you have provided for club starter kit V2, where i just need to select the user type fill in the text box and send the email... when i click on send email i get this error...

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 57:
Line 58: Dim mem As MembershipUser = Membership.GetUser()
Line 59: Dim gui As New Guid(mem.ProviderUserKey.ToString)
Line 60: Dim name As String = GetName(gui)
Line 61: Dim msgFrom As New MailAddress(mem.Email.ToString(), name.ToString())

Can sme one please help... :0(

Thanks in advance
Dips
Coordinator
Jun 19, 2007 at 12:45 PM
Are you logged in? Or did you bypass the security?
Jun 19, 2007 at 6:02 PM
i bypass the security...
Jun 19, 2007 at 6:22 PM
I added it to the webconfig file and it works now...

thanks...