locked
AspNet.Identity.MySQL - System.NullReferenceException RRS feed

  • Question

  • User1101756487 posted

    Hi!
    I have followed this document well. But, when I'm running the app and navigate to Register page, it's indicate this error, System.NullReferenceException: 'Object reference not set to an instance of an object.' 

    What can be the problem? I'm using visual studio 2019. 

    Please help. Thank you! 

    Friday, July 24, 2020 7:23 PM

Answers

  • User1101756487 posted

    SOLVED!

    I need to provide [HttpGet] method in AccountController.cs

    Below is sample code for Register,

    // GET: /Account/Register
    [HttpGet]
    [AllowAnonymous]
    public ActionResult Register()
    {
        RegisterViewModel register_Model = new RegisterViewModel();
        return View(register_Model);

    }

    We need to do this on every pages Login, password rest etc...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 25, 2020 4:44 AM