"Object reference not set to an instance of an object." building web-site that refencens Sql

Viewed 11

enter image description here

Error Code:

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=App_Web_wqenkxqv
  StackTrace:
   at ASP._Page_Views_Writer_EditWriter_cshtml.Execute() in C:\Users\HP\Source\Repos\Social-Media-Site\Social-Media-Site\Views\Writer\EditWriter.cshtml:line 61

View Code:

https://gist.github.com/BarisKarapelit/4852cc995bee0a5b175fa11a8bac7144

Controller Code:

https://gist.github.com/BarisKarapelit/69d03fce2ee97493382be5a3274c8ada

If you leave one of the inputs blank and after clicking the update button, the returned object returns empty. I used Validation. Normally, validation works and a warning should appear under the empty input, but it does not.

0 Answers
Related