MVC5 / C# – Cannot perform runtime binding on a null reference

There are two issues in your code: Consider this: This simplified piece of code throws Cannot perform runtime binding on a null reference since speakers is not defined (null reference). You can fix it by defining speakers in the dynamic ViewBag before the loop: The second issue: speakers in your code is a List, you might want to define ViewBag.speakers as a List<List<string>> and call .Add(speakers) instead … Read more

HTTP Error 500.19 and error code : 0x80070021

Got precisely the same error and came to this question. As @SpaceBison mentioned in comments, this answer describes the solution – https://stackoverflow.com/a/12867753/404099. I spotted it too late and it misses some steps. This is what worked for me: Windows Server 2012, IIS 8.5. Should work for other versions too. Go to server manager, click add roles … Read more

How to bind a model to a kendo Combobox in order to use the models validatation?

If you use Html.Kendo().ComboBoxFor() you can bind it to a model property similar to this: Note that when doing this, you don’t need the Name() or Value() properties because they will be handled when using the ComboBoxFor() This will take care of binding the control to the model and also allow you to use the validation. Also, one thing I missed in … Read more

limitations of using @Html.EditorForModel

I am working on an asp.net mvc-5 web application. I have the following model class :- now i usually use @Html.EditorFor() & LabelFor() at the field level. but for this model i wanted to start using @Html.EditorForModel as i will have less markup on the view:- now the result of this was not 100% what i was expecting:- so can any … Read more

error code: 523