asp.net mvc save button not working [closed]
When I remove this line from my view:
<%= Html.HiddenFor(m => m.compareWith.questionID)%>
The submit button works. The View is being validated with Microsoft client-side validation, and I initially thought that was the cause but I disabled it and the problem still occurs.
compareWith is an objec开发者_StackOverflowt of the same class as m. The HTML looks like:
<div class="compareWith">
<input id="compareWith_questionID" type="hidden" value="23" name="compareWith.questionID">
<span class="left">Compare with:</span>
An ORM is being used so it will lazy-load the compareWith object once it is used.
Actually, the button is working, there is just an internal server error between there and the controller so it never calls the controller. But it goes away when I remove that line.
The error was caused by the fact I just overrode the Equals method of the class that compareWith belongs to and it tried to compare something that was null...
The error was caused by the fact I just overrode the Equals method of the class that compareWith belongs to and it tried to compare something that was null...
精彩评论