0

i keep getting the error "'Object reference not set to an instance of an object.'" every time i run my program.

i have a form, in that the basic editing has this error. When i click on edit, it redirects me to the code and this exception arise.

Also it says, "System.Web.Mvc.WebViewPage.Model.get returned null. "

@model MVCApplication.ViewModel.UserViewModel


@{
    ViewBag.Title = "Edit User";
    Layout = "~/Views/Shared/_Layout.cshtml"; *here the error comes.
} 

i expect it to show me the edit screen.

phuzi
  • 12,078
  • 3
  • 26
  • 50
Raven231
  • 13
  • 6
  • Can you show us rest of your edit page and your controller action and model – adolja Jun 10 '19 at 08:00
  • Possible duplicate of [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – marc_s Jun 10 '19 at 08:13

0 Answers0