开发者

asp.net mvc save button not working [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜