0

My registration get and post method was working without error and now it generates the following error after post: enter image description here

Here is my registration get and post

What am I missing?

Skullomania
  • 2,225
  • 2
  • 29
  • 65
  • Hi, please post errors as text and a minimal code snippet here. The error suggest you are using the wrong kind of parameter in the ViewData. Check this for more info: https://msdn.microsoft.com/en-us/library/system.web.webpages.html.htmlhelper.dropdownlist(v=vs.111).aspx – Stefan Apr 19 '17 at 00:14
  • Because you return the view because `ModelState` is invalid but you did not populate the value of `ViewBag.Name` in the POST method (as your did in the GET method) so its `null` and –  Apr 19 '17 at 00:21
  • @Stefan I was trying to keep from posting too much code here. I wanted to show what was going on in the post and the get methods without making a the reader scroll to much – Skullomania Apr 19 '17 at 00:48
  • @Skullomania: I understand; but if you only post the relevant stuff, leaving out the authentication stuff for example, you'll get more points :-) – Stefan Apr 19 '17 at 07:37

0 Answers0