locked
Membership.CreateUser() Null Exception RRS feed

  • Question

  • User1765954050 posted

    I use Membership.CreateUser() method to create user , it works fine when browsing site locally i.e. with in LAN but when I put my site Online and access it from outside my network it gave Null Exception.

    Membership.CreateUser("Name", "password" "Email", "Question", "Answer", true, out result);               
                    MembershipUser u = Membership.GetUser(Name);
                    u.Comment = "1";
                    Membership.UpdateUser(u);

    Kindly help

    Thanks

    Friday, May 2, 2014 12:44 AM

Answers

  • User1140095199 posted

    Hi,

      Greetings!

     

    I use Membership.CreateUser() method to create user , it works fine when browsing site locally i.e. with in LAN but when I put my site Online and access it from outside my network it gave Null Exception

    Membership.CreateUser("Name", "password" "Email", "Question", "Answer", true, out result);  

    Password and Email are two different fields. Use a Comma ( , ) between them.

     MembershipUser newUser = Membership.CreateUser(
            UsernameTextbox.Text, 
            PasswordTextbox.Text, 
            EmailTextbox.Text,
            PasswordQuestionTextbox.Text,
            PasswordAnswerTextbox.Text,
            false,
            out result);
    

    For more reference - http://msdn.microsoft.com/en-us/library/t8yy6w3h(v=vs.110).aspx

    from outside my network it gave Null Exception.

    Could you please elaborate more. Perhaps POST the stacktrace.

    Take a look at the StackTrace it will have more information.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 5, 2014 4:10 AM