Member
13 Points
98 Posts
Feb 16, 2021 09:52 PM|valenciano8|LINK
It's this line :
@foreach(var category in (List<Category>)ViewData["CategoryList"])
But I don't understand how it can produce a NullReferenceException as the HTML Code hereafter shows that it retreived entities through CategoryList :
<form id="editor_pane" method="POST"> <input type="list" list="Category" placeholder="Catégorie" name="Category"> <datalist id="Category"> <option value="NodeJS"></option> <option value="csharp"></option> </datalist> <input type="text" placeholder="Saisissez le titre de votre astuce/article ici" name="Title"> <input type="text" placeholder="Description" name="Description"> </form>
Member
13 Points
98 Posts
Re: [MVC] Strange NullReferenceException
Feb 16, 2021 09:52 PM|valenciano8|LINK
It's this line :
But I don't understand how it can produce a NullReferenceException as the HTML Code hereafter shows that it retreived entities through CategoryList :